Skip to content

Commit 36c4eb7

Browse files
committed
test: add test related weekday buttons when recurrenceForm is readonly
1 parent 19daed4 commit 36c4eb7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/devextreme/js/__internal/scheduler/appointment_popup/appointment_popup.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,30 @@ describe('Appointment Form', () => {
10811081
expect(POM.popup.isRecurrenceGroupVisible()).toBe(true);
10821082
});
10831083

1084+
it('should have disabled week day buttons when allowUpdating is false', async () => {
1085+
const { POM, scheduler } = await createScheduler({
1086+
...getDefaultConfig(),
1087+
dataSource: [{ ...recurringAppointment, recurrenceRule: 'FREQ=WEEKLY;BYDAY=WE,TU,TH,FR,SA' }],
1088+
editing: { allowUpdating: false },
1089+
});
1090+
1091+
const dataSource = (scheduler as any).getDataSource();
1092+
const appointment = dataSource.items()[0];
1093+
1094+
scheduler.showAppointmentPopup(appointment);
1095+
POM.popup.openRecurrenceSettings();
1096+
1097+
const weekDayButtons = POM.popup.recurrenceWeekDayButtons;
1098+
expect(weekDayButtons).toBeTruthy();
1099+
1100+
const firstButton = weekDayButtons?.querySelector('.dx-button');
1101+
expect(firstButton).toBeTruthy();
1102+
1103+
// @ts-expect-error
1104+
const buttonInstance = $(firstButton).dxButton('instance');
1105+
expect(buttonInstance?.option('disabled')).toBe(true);
1106+
});
1107+
10841108
it('should be visible after changing repeat editor\'s value', async () => {
10851109
const { scheduler, POM } = await createScheduler(getDefaultConfig());
10861110

0 commit comments

Comments
 (0)