Skip to content

Commit

Permalink
add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
anveshmekala committed Feb 12, 2025
1 parent 2cb566b commit 86054f1
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,37 @@ describe("calcite-input-date-picker", () => {
expect(await calendar.isVisible()).toBe(true);
});

it("should not close date-picker when user navigate using chevrons & min, max are set to adjacent months", async () => {
const page = await newE2EPage();
await page.setContent(
html`<calcite-input-date-picker
min="2024-08-10"
value="2024-09-15"
max="2024-09-14"
></calcite-input-date-picker>`,
);

const calendar = await page.find(`calcite-input-date-picker >>> .${CSS.calendarWrapper}`);
expect(await calendar.isVisible()).toBe(false);

const input = await page.find("calcite-input-date-picker >>> calcite-input-text");
await input.click();
await page.waitForChanges();
expect(await calendar.isVisible()).toBe(true);

await navigateMonth(page, "previous");
await page.waitForChanges();
expect(await calendar.isVisible()).toBe(true);

await navigateMonth(page, "next");
await page.waitForChanges();
expect(await calendar.isVisible()).toBe(true);

await navigateMonth(page, "previous");
await page.waitForChanges();
expect(await calendar.isVisible()).toBe(true);
});

it("should not close date-picker when user navigate to last valid month in range", async () => {
const page = await newE2EPage();
await page.setContent(
Expand Down

0 comments on commit 86054f1

Please sign in to comment.