From 8505495d11ef2494c204daac5e68d71caf6cd406 Mon Sep 17 00:00:00 2001 From: kshitij katiyar Date: Wed, 18 Sep 2024 19:52:34 +0530 Subject: [PATCH] [MM-770]: removed extra comments --- .../modals/create_issue/create_issue.test.jsx | 183 ------------------ webapp/tests/setup.tsx | 3 - 2 files changed, 186 deletions(-) diff --git a/webapp/src/components/modals/create_issue/create_issue.test.jsx b/webapp/src/components/modals/create_issue/create_issue.test.jsx index 79da1234d..73b931aad 100644 --- a/webapp/src/components/modals/create_issue/create_issue.test.jsx +++ b/webapp/src/components/modals/create_issue/create_issue.test.jsx @@ -110,186 +110,3 @@ describe('CreateIssueModal', () => { expect(selectors).not.toBeNull(); }); }); - - - - - - - - - - - - - - - - - - - - - - - - - - -// import React from 'react'; -// import { shallow } from 'enzyme'; -// import CreateIssueModal from './create_issue'; - -// jest.mock('utils/user_utils', () => ({ -// getErrorMessage: jest.fn(() => 'Error occurred'), -// })); - -// describe('CreateIssueModal', () => { -// const defaultProps = { -// close: jest.fn(), -// create: jest.fn(() => Promise.resolve({})), -// post: null, -// title: '', -// channelId: '', -// theme: { -// centerChannelColor: '#000', -// centerChannelBg: '#fff' -// }, -// visible: true, -// }; - -// it('should render correctly with default props', () => { -// const wrapper = shallow(); -// expect(wrapper).toMatchSnapshot(); -// }); - -// it('should call close prop when handleClose is called', () => { -// const wrapper = shallow(); -// wrapper.instance().handleClose(); -// expect(defaultProps.close).toHaveBeenCalled(); -// }); - -// it('should call create prop when form is submitted with valid data', async () => { -// const wrapper = shallow(); -// wrapper.setState({ issueTitle: 'Test Issue' }); - -// await wrapper.instance().handleCreate({ preventDefault: () => {} }); -// expect(defaultProps.create).toHaveBeenCalled(); -// }); - -// it('should display error message when create returns an error', async () => { -// const errorProps = { -// ...defaultProps, -// create: jest.fn(() => Promise.resolve({ error: { message: 'Some error' } })), -// }; - -// const wrapper = shallow(); -// wrapper.setState({ issueTitle: 'Test Issue' }); - -// await wrapper.instance().handleCreate({ preventDefault: () => {} }); -// wrapper.update(); - -// expect(wrapper.find('.help-text.error-text').text()).toEqual('Error occurred'); -// }); -// }); - - - -///// IN ONE /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - - - - - - - - - -// import React from 'react'; -// import { shallow } from 'enzyme'; -// import CreateIssueModal from './create_issue'; - -// describe('CreateIssueModal', () => { -// const defaultProps = { - // close: jest.fn(), - // create: jest.fn(), - // post: { message: 'Post message' }, - // title: 'Initial Title', - // channelId: 'channel-123', - // theme: { - // centerChannelColor: '#000', - // centerChannelBg: '#fff' - // }, - // visible: true, - // }; - -// // it('should initialize state correctly from props', () => { -// // const wrapper = shallow(); -// // expect(wrapper.state('issueDescription')).toBe('Post message'); -// // expect(wrapper.state('issueTitle')).toBe('Initial Title'); -// // }); - -// // it('should update state when post prop changes', () => { -// // const wrapper = shallow(); -// // expect(wrapper.state('issueDescription')).toBe('Post message'); - -// // // Update props -// // wrapper.setProps({ post: { message: 'New post message' } }); -// // wrapper.update(); // Force re-render to make sure `componentDidUpdate` runs -// // expect(wrapper.state('issueDescription')).toBe('New post message'); -// // }); - -// it('should update state when channelId or title props change', () => { -// const wrapper = shallow(); -// expect(wrapper.state('issueTitle')).toBe('Initial Title'); - -// // Update props -// wrapper.setProps({ title: 'New Title', channelId: 'channel-456' }); -// wrapper.update(); -// expect(wrapper.state('issueTitle')).toBe('New Title'); -// }); -// }); - - -//c ------------------------------------------------------- - - - -// import React from 'react'; -// import { shallow } from 'enzyme'; -// import CreateIssueModal from './create_issue'; - -// describe('CreateIssueModal', () => { -// let wrapper; -// const defaultProps = { -// close: jest.fn(), -// create: jest.fn(), -// post: null, -// title: '', -// channelId: '', -// theme: { -// centerChannelColor: '#000', -// centerChannelBg: '#fff' -// }, -// visible: true, -// }; - -// beforeEach(() => { -// wrapper = shallow(); -// wrapper.setState({ repo: { name: 'test-repo', permissions: { push: true } } }); -// wrapper.update(); -// }); - -// it('should render issue attribute selectors when repo is selected', () => { -// expect(wrapper.find('GithubLabelSelector').exists()).toBe(true); -// // expect(wrapper.find('GithubAssigneeSelector').exists()).toBe(true); -// // expect(wrapper.find('GithubMilestoneSelector').exists()).toBe(true); -// }); -// }); diff --git a/webapp/tests/setup.tsx b/webapp/tests/setup.tsx index 7848cb867..75f1d053f 100644 --- a/webapp/tests/setup.tsx +++ b/webapp/tests/setup.tsx @@ -1,6 +1,3 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - import Adapter from 'enzyme-adapter-react-16'; import {configure} from 'enzyme';