diff --git a/packages/ringcentral-widgets-test/__test__/integration-test/Meeting/ScheduleMeeting.spec.js b/packages/ringcentral-widgets-test/__test__/integration-test/Meeting/ScheduleMeeting.spec.js deleted file mode 100644 index 3e050693d..000000000 --- a/packages/ringcentral-widgets-test/__test__/integration-test/Meeting/ScheduleMeeting.spec.js +++ /dev/null @@ -1,178 +0,0 @@ -import moment from 'moment'; -import { MeetingType } from '@ringcentral-integration/commons/helpers/meetingHelper'; -import MeetingSection from '@ringcentral-integration/widgets/components/MeetingSection'; -import NavigationBar from '@ringcentral-integration/widgets/components/NavigationBar'; -import { sleep } from '@ringcentral-integration/commons/utils'; -import { getWrapper } from '../shared'; - -let app = null; -beforeAll(async () => { - jest.setTimeout(64000); - app = await getWrapper(); - // Nav to Meeting page - const navigationBar = app.find(NavigationBar).first(); - await navigationBar.props().goTo('/meeting'); - app.update(); -}); - -// TODO: skip fix in next mr -describe.skip('Schedule Meeting', () => { - const EXPECT_HOUR = 5; - const EXPECT_MINUTES = 15; - test('', async () => { - const topic = app.find(MeetingSection).first(); - const maxInput = '#'.repeat(128); - const exceedInput = `${maxInput}#`; - topic.find('input').simulate('change', { target: { value: maxInput } }); - // To fit the Debounce timeout on MeetingPanel - await sleep(10); - expect(app.props().phone.meeting.meeting.topic).toBe(maxInput); - // Exceed 128 chars length should failed and keep the origin - topic.find('input').simulate('change', { target: { value: exceedInput } }); - await sleep(10); - expect(app.props().phone.meeting.meeting.topic).not.toBe(exceedInput); - topic.find('input').simulate('change', { target: { value: 'aloha' } }); - await sleep(10); - expect(app.props().phone.meeting.meeting.topic).toBe('aloha'); - }); - test('', async () => { - let when = app.find(MeetingSection).at(1); - // Tolerance one minute range - const now = moment(Date.now()); - expect( - moment(app.props().phone.meeting.meeting.schedule.startTime).diff( - now, - 'minutes', - ), - ).toBeLessThanOrEqual(60); - // DATE - const dateField = when.find('DateTimePicker').at(0); - const expectedDate = now.add(1, 'days'); - dateField.props().onChange(expectedDate.toDate()); - app.update(); - // Time - expectedDate.hours(EXPECT_HOUR).minutes(EXPECT_MINUTES); - when = app.find(MeetingSection).at(1); - const timeField = when.find('DateTimePicker').at(1); - timeField.props().onChange(expectedDate.toDate()); - app.update(); - - await sleep(100); - const actualDate = moment( - app.props().phone.meeting.meeting.schedule.startTime, - ); - expect(actualDate.diff(expectedDate, 'minutes')).toBeLessThan(1); - }); - test('', async () => { - const duration = app.find(MeetingSection).at(2); - expect(app.props().phone.meeting.meeting.schedule.durationInMinutes).toBe( - 60, - ); - const hourField = duration.find('DropdownList').first(); - hourField.props().onChange({ value: EXPECT_HOUR }); - expect(app.props().phone.meeting.meeting.schedule.durationInMinutes).toBe( - EXPECT_HOUR * 60, - ); - const minuteField = duration.find('DropdownList').at(1); - minuteField.props().onChange({ value: EXPECT_MINUTES }); - expect(app.props().phone.meeting.meeting.schedule.durationInMinutes).toBe( - EXPECT_HOUR * 60 + EXPECT_MINUTES, - ); - }); - test('', async () => { - const recurring = app.find(MeetingSection).at(3); - expect(app.props().phone.meeting.meeting.meetingType).toBe('Scheduled'); - const typeField = recurring.find('Switch').first(); - typeField.props().onChange(false); - expect(app.props().phone.meeting.meeting.meetingType).toBe( - MeetingType.SCHEDULED, - ); - typeField.props().onChange(true); - const meetingType = app.props().phone.meeting.meeting.meetingType; - expect( - meetingType === MeetingType.RECURRING || - meetingType === MeetingType.SCHEDULED_RECURRING, - ).toBe(true); - }); - test('