From 891421d00001f5bbf868ce15ffbb52c4a1bb92eb Mon Sep 17 00:00:00 2001 From: Yana Date: Tue, 12 May 2020 18:20:57 +0300 Subject: [PATCH] Add test --- .../appointmentPopup.tests.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js b/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js index dc108e058713..44d97514fb12 100644 --- a/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js +++ b/testing/tests/DevExpress.ui.widgets.scheduler/appointmentPopup.tests.js @@ -9,6 +9,7 @@ import SchedulerTimezoneEditor from 'ui/scheduler/timezones/ui.scheduler.timezon import fx from 'animation/fx'; import { DataSource } from 'data/data_source/data_source'; import resizeCallbacks from 'core/utils/resize_callbacks'; +import messageLocalization from 'localization/message'; import 'ui/scheduler/ui.scheduler'; import 'ui/switch'; @@ -1058,6 +1059,22 @@ QUnit.test('Done button shouldn\'t be disabled if validation fail', function(ass assert.equal(doneButton.option('disabled'), false, 'done button is not disabled'); }); +QUnit.test('Done button default configuration should be correct', function(assert) { + this.instance.option({ + onAppointmentFormOpening: function(e) { + const popup = e.component.getAppointmentPopup(); + const buttons = popup.option('toolbarItems'); + const doneButton = buttons[0]; + + assert.equal(doneButton.options.text, messageLocalization.format('Done'), 'done button text is ok'); + }, + onAppointmentAdding: function(e) { + e.cancel = true; + } + }); + this.instance.showAppointmentPopup({ startDate: new Date(2015, 1, 1, 1), endDate: new Date(2015, 1, 1, 2), text: 'caption' }); +}); + QUnit.test('Done button custom configuration should be correct', function(assert) { const data = new DataSource({ store: this.tasks