From 9fd65cbeeb6eff31adbfdb5f270bdca311fb7910 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 29 Nov 2023 16:27:34 -0500 Subject: [PATCH] test(datetime): verify the datetime scrolls to value when 1 value set with multiple --- .../datetime/test/set-value/datetime.e2e.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/src/components/datetime/test/set-value/datetime.e2e.ts b/core/src/components/datetime/test/set-value/datetime.e2e.ts index 798b87144a..cf00c4fc84 100644 --- a/core/src/components/datetime/test/set-value/datetime.e2e.ts +++ b/core/src/components/datetime/test/set-value/datetime.e2e.ts @@ -62,5 +62,29 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => const calendarHeader = datetime.locator('.calendar-month-year'); await expect(calendarHeader).toHaveText(/May 2021/); }); + + test('should scroll to new month when value is initially set and then updated with multiple selection', async ({ + page, + }) => { + await page.setContent( + ` + + + `, + config + ); + + await page.waitForSelector('.datetime-ready'); + + const datetime = page.locator('ion-datetime'); + await datetime.evaluate((el: HTMLIonDatetimeElement) => (el.value = '2021-05-25T12:40:00.000Z')); + await page.waitForChanges(); + + const calendarHeader = datetime.locator('.calendar-month-year'); + await expect(calendarHeader).toHaveText(/May 2021/); + }); }); });