Skip to content

Commit 2dbea14

Browse files
Scheduler - Remove legacy QUnit tests covered by jest
1 parent 51d78c5 commit 2dbea14

4 files changed

Lines changed: 0 additions & 255 deletions

File tree

packages/devextreme/testing/helpers/scheduler/helpers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ export class SchedulerTestWrapper extends ElementWrapper {
605605
setStartDate: (value) => this.appointmentForm.getEditor('startDateEditor').option('value', value),
606606
setEndDate: (value) => this.appointmentForm.getEditor('endDateEditor').option('value', value),
607607

608-
hasFormSingleColumn: () => $('.dx-responsivebox').first().hasClass('dx-responsivebox-screen-xs'),
609608
getRecurrentAppointmentFormDialogButtons: () => $('.dx-dialog-buttons .dx-button'),
610609
clickFormDialogButton: (index = 0) => this.appointmentForm.getRecurrentAppointmentFormDialogButtons().eq(index).trigger('dxclick'),
611610
getPendingEditorsCount: () => $(this.appointmentForm.getFormInstance().element()).find('.dx-validation-pending').length,

packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/appointment.editing.tests.js

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -171,32 +171,6 @@ module('Integration: Appointment editing', {
171171
assert.expect(2);
172172
});
173173

174-
test('Add new appointment', async function(assert) {
175-
const data = new DataSource({
176-
store: this.tasks
177-
});
178-
179-
const scheduler = await this.createInstance({
180-
currentDate: new Date(2015, 1, 9),
181-
dataSource: data,
182-
183-
});
184-
const addAppointment = scheduler.instance.addAppointment;
185-
const spy = sinon.spy(() => new Deferred());
186-
const newItem = { startDate: new Date(2015, 1, 1, 1), endDate: new Date(2015, 1, 1, 2), text: 'caption' };
187-
scheduler.instance.addAppointment = spy;
188-
try {
189-
scheduler.instance.showAppointmentPopup(newItem, true);
190-
191-
$('.dx-scheduler-appointment-popup .dx-popup-done').trigger('dxclick');
192-
193-
assert.ok(spy.calledOnce, 'Add method is called');
194-
assert.deepEqual(spy.getCall(0).args[0], { ...newItem, allDay: false, recurrenceRule: '' }, 'New item is correct');
195-
} finally {
196-
scheduler.instance.addAppointment = addAppointment;
197-
}
198-
});
199-
200174
test('Add new appointment with delay(T381444)', async function(assert) {
201175
const done = assert.async();
202176
const data = [];
@@ -271,37 +245,6 @@ module('Integration: Appointment editing', {
271245
const popup = scheduler.instance.appointmentPopup.popup;
272246
});
273247

274-
// TODO: update editors in popup
275-
test('Update appointment', async function(assert) {
276-
const data = new DataSource({
277-
store: this.tasks
278-
});
279-
280-
const scheduler = await this.createInstance({
281-
currentDate: new Date(2015, 1, 9),
282-
dataSource: data,
283-
284-
});
285-
286-
const updateAppointment = scheduler.instance.updateAppointment;
287-
const spy = sinon.spy(() => new Deferred());
288-
const updatedItem = this.tasks[0];
289-
scheduler.instance.updateAppointment = spy;
290-
try {
291-
scheduler.instance.showAppointmentPopup(updatedItem);
292-
293-
$('.dx-scheduler-appointment-popup .dx-popup-done').trigger('dxclick');
294-
295-
hide();
296-
297-
assert.ok(spy.calledOnce, 'Update method is called');
298-
assert.deepEqual(spy.getCall(0).args[0], updatedItem, 'Target item is correct');
299-
assert.deepEqual(spy.getCall(0).args[1], { ...updatedItem, allDay: false, recurrenceRule: '' }, 'New data is correct');
300-
} finally {
301-
scheduler.instance.updateAppointment = updateAppointment;
302-
}
303-
});
304-
305248
test('Scheduler should add only one appointment at multiple "done" button clicks on appointment form', async function(assert) {
306249
const a = { text: 'a', startDate: new Date(2017, 7, 9), endDate: new Date(2017, 7, 9, 0, 15) };
307250
const scheduler = await createWrapper({

packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.adaptivity.tests.js

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -146,78 +146,6 @@ module('Mobile tooltip', moduleConfig, () => {
146146
});
147147
});
148148

149-
if(isDesktopEnvironment()) {
150-
module('Appointment form on desktop', {
151-
beforeEach() {
152-
fx.off = true;
153-
},
154-
155-
afterEach() {
156-
fx.off = false;
157-
resetWindowWidth();
158-
}
159-
}, () => {
160-
test('Items has layout with one column when the form\'s width < 600px', async function(assert) {
161-
const scheduler = await createInstance({ });
162-
setWindowWidth(500);
163-
scheduler.appointments.compact.click();
164-
scheduler.tooltip.clickOnItem();
165-
166-
assert.ok(scheduler.appointmentForm.hasFormSingleColumn(), 'Appointment form has single column');
167-
});
168-
169-
test('Items with recurrence editor has layout with one column when the form\'s width < 600px', async function(assert) {
170-
const scheduler = await createInstance({ });
171-
setWindowWidth(500);
172-
scheduler.option('dataSource', [{
173-
startDate: new Date(2015, 1, 1),
174-
endDate: new Date(2015, 1, 2),
175-
recurrenceRule: 'FREQ=WEEKLY'
176-
}]);
177-
scheduler.appointments.compact.click();
178-
scheduler.tooltip.clickOnItem();
179-
$('.dx-dialog-buttons .dx-button').eq(0).trigger('dxclick');
180-
181-
assert.ok(scheduler.appointmentForm.hasFormSingleColumn(), 'Appointment form has single column');
182-
});
183-
184-
test('Items has layout with one column when the form\'s width < 600px on window resizing', async function(assert) {
185-
const scheduler = await createInstance({ });
186-
setWindowWidth(700);
187-
scheduler.appointments.compact.click();
188-
scheduler.tooltip.clickOnItem();
189-
190-
setWindowWidth(500);
191-
resizeCallbacks.fire();
192-
193-
assert.ok(scheduler.appointmentForm.hasFormSingleColumn(), 'Appointment form has single column');
194-
});
195-
196-
});
197-
}
198-
199-
if(!isDesktopEnvironment()) {
200-
module('Appointment form on mobile', {
201-
beforeEach() {
202-
fx.off = true;
203-
setWindowWidth(800);
204-
},
205-
206-
afterEach() {
207-
fx.off = false;
208-
resetWindowWidth();
209-
}
210-
}, () => {
211-
test('Items has layout with one column', async function(assert) {
212-
const scheduler = await createInstance({ });
213-
scheduler.appointments.compact.click();
214-
scheduler.tooltip.clickOnItem();
215-
216-
assert.ok(scheduler.appointmentForm.hasFormSingleColumn(), 'Appointment form has single column');
217-
});
218-
});
219-
}
220-
221149
if(isDesktopEnvironment()) {
222150
module('Appointment popup size, desktop', {
223151
beforeEach() {

packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.recurringAppointments.tests.js

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -660,59 +660,6 @@ supportedScrollingModes.forEach(scrollingMode => {
660660
$('.dx-dialog-buttons .dx-button').eq(1).trigger('dxclick');
661661
});
662662

663-
test('Recurrent Task editing, single mode', async function(assert) {
664-
const data = new DataSource({
665-
store: [
666-
{
667-
text: 'Task 1',
668-
startDate: new Date(2015, 1, 9, 1, 0),
669-
endDate: new Date(2015, 1, 9, 2, 0),
670-
recurrenceRule: 'FREQ=DAILY'
671-
}
672-
]
673-
});
674-
675-
const updatedItem = {
676-
text: 'Task 2',
677-
startDate: new Date(2015, 1, 11, 3),
678-
endDate: new Date(2015, 1, 11, 4),
679-
allDay: false,
680-
recurrenceRule: '',
681-
};
682-
683-
const scheduler = await this.createInstance({
684-
currentDate: new Date(2015, 1, 9),
685-
dataSource: data,
686-
currentView: 'week',
687-
firstDayOfWeek: 1,
688-
689-
});
690-
691-
const clock = sinon.useFakeTimers();
692-
await scheduler.appointments.click(2, clock);
693-
scheduler.tooltip.clickOnItem();
694-
$('.dx-dialog-buttons .dx-button').eq(1).trigger('dxclick');
695-
696-
const $title = $('.dx-textbox').eq(0);
697-
const title = $title.dxTextBox('instance');
698-
const $startTime = $('.dx-datebox').eq(1);
699-
const startTime = $startTime.dxDateBox('instance');
700-
701-
title.option('value', 'Task 2');
702-
startTime.option('value', new Date(2015, 1, 11, 3, 0));
703-
$('.dx-button.dx-popup-done').eq(0).trigger('dxclick');
704-
await clock.tickAsync(300);
705-
clock.restore();
706-
707-
const updatedSingleItem = scheduler.instance.option('dataSource').items()[1];
708-
const updatedRecurringItem = scheduler.instance.option('dataSource').items()[0];
709-
const exceptionDate = new Date(2015, 1, 11, 1, 0, 0, 0);
710-
711-
assert.deepEqual(updatedSingleItem, updatedItem, 'New data is correct');
712-
713-
assert.equal(updatedRecurringItem.recurrenceException, dateSerialization.serializeDate(exceptionDate, 'yyyyMMddTHHmmssZ'), 'Exception for recurrence appointment is correct');
714-
});
715-
716663
test('Recurrent Task editing, single mode, should not reference copy recurrent data (T1228488)', async function(assert) {
717664
const updatedItem = {
718665
text: 'Task 2',
@@ -763,78 +710,6 @@ supportedScrollingModes.forEach(scrollingMode => {
763710
assert.deepEqual(updatedRecurringItem.customData.texts, ['123'], 'Recurrence data is correct');
764711
});
765712

766-
test('Recurrent Task edition canceling, single mode', async function(assert) {
767-
const data = new DataSource({
768-
store: [
769-
{
770-
text: 'Task 1',
771-
startDate: new Date(2015, 1, 9, 1, 0),
772-
endDate: new Date(2015, 1, 9, 2, 0),
773-
recurrenceRule: 'FREQ=DAILY'
774-
}
775-
]
776-
});
777-
778-
const scheduler = await this.createInstance({
779-
currentDate: new Date(2015, 1, 9),
780-
dataSource: data,
781-
currentView: 'week',
782-
firstDayOfWeek: 1
783-
});
784-
785-
const clock = sinon.useFakeTimers();
786-
$(scheduler.instance.$element()).find('.dx-scheduler-appointment').eq(2).trigger('dxclick');
787-
await clock.tickAsync(300);
788-
$('.dx-scheduler-appointment-tooltip-buttons .dx-button').eq(1).trigger('dxclick');
789-
$('.dx-dialog-buttons .dx-button').eq(1).trigger('dxclick');
790-
$('.dx-button.dx-popup-cancel').eq(0).trigger('dxclick');
791-
792-
$(scheduler.instance.$element()).find('.dx-scheduler-appointment').eq(2).trigger('dxclick');
793-
await clock.tickAsync(300);
794-
$('.dx-scheduler-appointment-tooltip-buttons .dx-button').eq(1).trigger('dxclick');
795-
$('.dx-dialog-buttons .dx-button').eq(0).trigger('dxclick');
796-
$('.dx-button.dx-popup-done').eq(0).trigger('dxclick');
797-
clock.restore();
798-
799-
const items = scheduler.instance.option('dataSource').items();
800-
801-
assert.equal(items.length, 1, 'Items are correct');
802-
});
803-
804-
test('Recurrent Task editing, single mode - canceling', async function(assert) {
805-
const data = new DataSource({
806-
store: [
807-
{
808-
text: 'Task 1',
809-
startDate: new Date(2015, 1, 9, 1, 0),
810-
endDate: new Date(2015, 1, 9, 2, 0),
811-
recurrenceRule: 'FREQ=DAILY'
812-
}
813-
]
814-
});
815-
816-
const scheduler = await this.createInstance({
817-
currentDate: new Date(2015, 1, 9),
818-
dataSource: data,
819-
currentView: 'week',
820-
firstDayOfWeek: 1
821-
});
822-
823-
const clock = sinon.useFakeTimers();
824-
$(scheduler.instance.$element()).find('.dx-scheduler-appointment').eq(2).trigger('dxclick');
825-
await clock.tickAsync(300);
826-
$('.dx-scheduler-appointment-tooltip-buttons .dx-button').eq(1).trigger('dxclick');
827-
$('.dx-dialog-buttons .dx-button').eq(1).trigger('dxclick');
828-
829-
$('.dx-button.dx-popup-cancel').eq(0).trigger('dxclick');
830-
await clock.tickAsync(300);
831-
clock.restore();
832-
833-
const recurrentItem = scheduler.instance.option('dataSource').items()[0];
834-
835-
assert.equal(recurrentItem.recurrenceException, undefined, 'Exception for recurrence appointment is correct');
836-
});
837-
838713
test('Recurrent Task editing, confirmation tooltip should be shown after double click on recurrent appointment', async function(assert) {
839714
const data = new DataSource({
840715
store: [

0 commit comments

Comments
 (0)