From 6fb2e92a9597192e7ae3e0dbd0e1da304c0a2d23 Mon Sep 17 00:00:00 2001 From: tongsonbarbs Date: Tue, 23 Jul 2024 19:02:25 +0800 Subject: [PATCH] T1243679 test case --- .../tests/scheduler/workSpace.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/e2e/testcafe-devextreme/tests/scheduler/workSpace.ts b/e2e/testcafe-devextreme/tests/scheduler/workSpace.ts index 714e32a2cb12..e54021ebe3fd 100644 --- a/e2e/testcafe-devextreme/tests/scheduler/workSpace.ts +++ b/e2e/testcafe-devextreme/tests/scheduler/workSpace.ts @@ -1,6 +1,7 @@ import { ClientFunction } from 'testcafe'; import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; import Scheduler, { CLASS } from 'devextreme-testcafe-models/scheduler'; +import Button from 'devextreme-testcafe-models/button'; import { extend } from 'devextreme/core/utils/extend'; import { createWidget } from '../../helpers/createWidget'; import url from '../../helpers/getPageUrl'; @@ -360,3 +361,40 @@ test('[T716993]: should has horizontal scrollbar with multiple resources and fix }).after(async () => { await removeStylesheetRulesFromPage(); }); + +test('Scheduler appointments should change color on update resources', async (t) => { + await t.wait(2000); + + await t.eval(() => { + // @ts-expect-error instance + const schedulerWidget = $('#container').dxScheduler('instance'); + schedulerWidget.option('resources', [{ + fieldExpr: 'resource', + dataSource: [{ id: 1, text: 'new res 1', color: 'pink' }], + }]); + schedulerWidget.getDataSource().reload(); + }); + + const { takeScreenshot, compareResults } = createScreenshotsComparer(t); + await takeScreenshot('scheduler-appointments-should-update-color.png'); + await t.expect(compareResults.isValid()).ok(compareResults.errorMessages()); +}).before(async () => { + await createWidget('dxScheduler', { + timeZone: 'America/Los_Angeles', + dataSource: [{ + text: 'Website Re-Design Plan', + startDate: new Date('2021-03-29T16:30:00.000Z'), + endDate: new Date('2021-03-29T18:30:00.000Z'), + resource: 1, + }], + views: ['week', 'month'], + currentView: 'week', + currentDate: new Date(2021, 2, 28), + startDayHour: 9, + height: 730, + resources: [{ + fieldExpr: 'resource', + dataSource: [{ id: 1, text: 'res 1', color: 'red' }], + }], + }); +});