forked from DevExpress/DevExtreme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scheduler(T1220324): resets data when Repeat switch is toggled (DevEx…
- Loading branch information
1 parent
d536491
commit 16c325e
Showing
7 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+37.7 KB
...stcafe/tests/scheduler/appointmentForm/etalons/recurrence-editor_after-hide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.3 KB
...ests/scheduler/appointmentForm/etalons/recurrence-editor_after-popup-reopen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.08 KB
...scheduler/appointmentForm/etalons/recurrence-editor_after-popup-reopen_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 129 additions & 0 deletions
129
testing/testcafe/tests/scheduler/appointmentForm/recurrenceEditor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import Scheduler from '../../../model/scheduler/index'; | ||
import AppointmentPopup from '../../../model/scheduler/appointment/popup'; | ||
import { createWidget } from '../../../helpers/createWidget'; | ||
import url from '../../../helpers/getPageUrl'; | ||
|
||
fixture.disablePageReloads`Appointment Form: recurrence editor` | ||
.page(url(__dirname, '../../container.html')); | ||
|
||
const SCHEDULER_SELECTOR = '#container'; | ||
|
||
const fillRecurrenceForm = async (t: TestController, popup: AppointmentPopup): Promise<void> => { | ||
await t.click(popup.recurrenceTypeElement); | ||
await t.click(popup.getRecurrenceTypeSelectItem(2)); | ||
await t.typeText(popup.repeatEveryElement, '10', { replace: true }); | ||
await t.click(popup.getEndRepeatRadioButton(1)); | ||
await t.typeText(popup.endRepeatDateElement, '01/01/2024', { replace: true }); | ||
}; | ||
|
||
test('Should not reset the recurrence editor value after the repeat toggling', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
const popup = scheduler.appointmentPopup; | ||
const cell = scheduler.getDateTableCell(0, 0); | ||
|
||
await t.doubleClick(cell); | ||
await t.click(popup.recurrenceElement); | ||
await fillRecurrenceForm(t, popup); | ||
await t.click(popup.recurrenceElement); | ||
await t.click(popup.recurrenceElement); | ||
|
||
await takeScreenshot('recurrence-editor_after-hide.png', popup.form); | ||
|
||
await t.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
await createWidget('dxScheduler', { | ||
dataSource: [], | ||
views: ['week'], | ||
currentView: 'week', | ||
currentDate: '2024-01-01T10:00:00', | ||
}); | ||
}); | ||
|
||
test('Should reset the recurrence editor value after the popup reopening', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
const popup = scheduler.appointmentPopup; | ||
const cell = scheduler.getDateTableCell(0, 0); | ||
|
||
await t.doubleClick(cell); | ||
await t.click(popup.recurrenceElement); | ||
await fillRecurrenceForm(t, popup); | ||
await t.click(popup.cancelButton); | ||
await t.doubleClick(cell); | ||
await t.click(popup.recurrenceElement); | ||
|
||
await takeScreenshot('recurrence-editor_after-popup-reopen.png', popup.form); | ||
|
||
await t.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
await createWidget('dxScheduler', { | ||
dataSource: [], | ||
views: ['week'], | ||
currentView: 'week', | ||
currentDate: '2024-01-01T10:00:00', | ||
}); | ||
}); | ||
|
||
test('Should correctly create usual appointment after repeat toggling', async (t) => { | ||
const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
const popup = scheduler.appointmentPopup; | ||
const cell = scheduler.getDateTableCell(0, 0); | ||
|
||
await t.doubleClick(cell); | ||
await t.click(popup.recurrenceElement); | ||
await t.click(popup.recurrenceElement); | ||
await t.click(popup.doneButton); | ||
|
||
await t.expect(scheduler.getAppointmentCount()).eql(1); | ||
}).before(async () => { | ||
await createWidget('dxScheduler', { | ||
dataSource: [], | ||
views: ['week'], | ||
currentView: 'week', | ||
currentDate: '2024-01-01T10:00:00', | ||
}); | ||
}); | ||
|
||
test('Should correctly create recurrent appointment', async (t) => { | ||
const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
const popup = scheduler.appointmentPopup; | ||
const cell = scheduler.getDateTableCell(0, 0); | ||
|
||
await t.doubleClick(cell); | ||
await t.click(popup.recurrenceElement); | ||
await t.click(popup.doneButton); | ||
|
||
await t.expect(scheduler.getAppointmentCount()).eql(7); | ||
}).before(async () => { | ||
await createWidget('dxScheduler', { | ||
dataSource: [], | ||
views: ['week'], | ||
currentView: 'week', | ||
currentDate: '2024-01-01T10:00:00', | ||
}); | ||
}); | ||
|
||
test('Should correctly create recurrent appointment after repeat toggle', async (t) => { | ||
const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
const popup = scheduler.appointmentPopup; | ||
const cell = scheduler.getDateTableCell(0, 0); | ||
|
||
await t.doubleClick(cell); | ||
await t.click(popup.recurrenceElement); | ||
await t.click(popup.recurrenceElement); | ||
await t.click(popup.recurrenceElement); | ||
await t.click(popup.doneButton); | ||
|
||
await t.expect(scheduler.getAppointmentCount()).eql(7); | ||
}).before(async () => { | ||
await createWidget('dxScheduler', { | ||
dataSource: [], | ||
views: ['week'], | ||
currentView: 'week', | ||
currentDate: '2024-01-01T10:00:00', | ||
}); | ||
}); |