From ef611e59a839ac6767f1bcceb9d4f4842e410047 Mon Sep 17 00:00:00 2001 From: "dilan.dogan2" Date: Tue, 24 Dec 2024 16:34:27 +0300 Subject: [PATCH] feat(datepicker): fix test --- src/components/datepicker/bl-datepicker.test.ts | 4 +++- .../datepicker-calendar-mixin/datepicker-calendar-mixin.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/datepicker/bl-datepicker.test.ts b/src/components/datepicker/bl-datepicker.test.ts index 36703738..36a52247 100644 --- a/src/components/datepicker/bl-datepicker.test.ts +++ b/src/components/datepicker/bl-datepicker.test.ts @@ -265,8 +265,10 @@ describe("BlDatepicker", () => { it("should return an array of dates when value is an array of Dates", () => { const dates = [new Date("2024-01-01"), new Date("2024-02-01")]; + element.type=CALENDAR_TYPES.MULTIPLE; element.value = dates; - expect(element.value).to.deep.equal(dates); + + expect(element.value).to.equal(dates); }); it("should return undefined if value is not set", () => { diff --git a/src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts b/src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts index 7940053c..f4d4ce84 100644 --- a/src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts +++ b/src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts @@ -130,7 +130,7 @@ export default class DatepickerCalendarMixin extends LitElement { ); } else { this._value = value; - this._selectedDates.splice(0, this._selectedDates.length, ...tempVal); + this._selectedDates = tempVal; } }