Skip to content

Commit 12bcc4a

Browse files
Ivan KitanovIvan Kitanov
authored andcommitted
(chore):Fixing drp calendar selection tests
1 parent 634a789 commit 12bcc4a

File tree

2 files changed

+60
-12
lines changed

2 files changed

+60
-12
lines changed

src/components/date-range-picker/date-range-picker-single.spec.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,16 @@ describe('Date range picker - single input', () => {
406406
const eventSpy = spy(picker, 'emitEvent');
407407

408408
picker.mode = 'dialog';
409-
const date1 = today.add('day', -2);
410-
const date2 = today.add('day', 2);
409+
const date1 = new CalendarDay({
410+
year: today.year,
411+
month: today.month,
412+
date: 10,
413+
});
414+
const date2 = new CalendarDay({
415+
year: today.year,
416+
month: today.month,
417+
date: 14,
418+
});
411419
picker.value = { start: today.native, end: tomorrow.native };
412420
await elementUpdated(picker);
413421

@@ -446,8 +454,16 @@ describe('Date range picker - single input', () => {
446454
const eventSpy = spy(picker, 'emitEvent');
447455

448456
picker.mode = 'dialog';
449-
const date1 = today.add('day', -2);
450-
const date2 = today.add('day', 2);
457+
const date1 = new CalendarDay({
458+
year: today.year,
459+
month: today.month,
460+
date: 10,
461+
});
462+
const date2 = new CalendarDay({
463+
year: today.year,
464+
month: today.month,
465+
date: 14,
466+
});
451467
picker.value = null;
452468
await elementUpdated(picker);
453469

@@ -486,8 +502,16 @@ describe('Date range picker - single input', () => {
486502
const eventSpy = spy(picker, 'emitEvent');
487503

488504
picker.mode = 'dialog';
489-
const date1 = today.add('day', -3);
490-
const date2 = today.add('day', 3);
505+
const date1 = new CalendarDay({
506+
year: today.year,
507+
month: today.month,
508+
date: 10,
509+
});
510+
const date2 = new CalendarDay({
511+
year: today.year,
512+
month: today.month,
513+
date: 14,
514+
});
491515
picker.value = { start: today.native, end: tomorrow.native };
492516
await elementUpdated(picker);
493517

src/components/date-range-picker/date-range-picker-two-inputs.spec.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,16 @@ describe('Date range picker - two inputs', () => {
395395
const eventSpy = spy(picker, 'emitEvent');
396396

397397
picker.mode = 'dialog';
398-
const date1 = today.add('day', -2);
399-
const date2 = today.add('day', 2);
398+
const date1 = new CalendarDay({
399+
year: today.year,
400+
month: today.month,
401+
date: 10,
402+
});
403+
const date2 = new CalendarDay({
404+
year: today.year,
405+
month: today.month,
406+
date: 14,
407+
});
400408
picker.value = { start: today.native, end: tomorrow.native };
401409
await elementUpdated(picker);
402410

@@ -427,8 +435,16 @@ describe('Date range picker - two inputs', () => {
427435
const eventSpy = spy(picker, 'emitEvent');
428436

429437
picker.mode = 'dialog';
430-
const date1 = today.add('day', -2);
431-
const date2 = today.add('day', 2);
438+
const date1 = new CalendarDay({
439+
year: today.year,
440+
month: today.month,
441+
date: 10,
442+
});
443+
const date2 = new CalendarDay({
444+
year: today.year,
445+
month: today.month,
446+
date: 14,
447+
});
432448
picker.value = null;
433449
await elementUpdated(picker);
434450

@@ -466,8 +482,16 @@ describe('Date range picker - two inputs', () => {
466482
const eventSpy = spy(picker, 'emitEvent');
467483

468484
picker.mode = 'dialog';
469-
const date1 = today.add('day', -3);
470-
const date2 = today.add('day', 3);
485+
const date1 = new CalendarDay({
486+
year: today.year,
487+
month: today.month,
488+
date: 10,
489+
});
490+
const date2 = new CalendarDay({
491+
year: today.year,
492+
month: today.month,
493+
date: 14,
494+
});
471495
picker.value = { start: today.native, end: tomorrow.native };
472496
await elementUpdated(picker);
473497

0 commit comments

Comments
 (0)