Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarovaya committed May 12, 2020
1 parent 6150292 commit 891421d
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 891421d

Please sign in to comment.