Skip to content

Commit

Permalink
sidebar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpkane committed Sep 24, 2024
1 parent 47f3b44 commit cb4c614
Showing 1 changed file with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,10 @@ test.describe("date field and date time field can filter visibility", () => {
() => true
);

await sidebar.clickFieldDropdown("dates");
await sidebar.clickFieldCheckbox("dates");
await sidebar.clickFieldDropdown("dates");
await entryExpandPromise;

const refresh = grid.getWaitForGridRefreshPromise();
await sidebar.changeSliderStartValue("dates", "2020‑12‑31", "2021‑01‑01");
await refresh;

expect(await page.getByTestId("tag-dates").count()).toBe(1);
expect(await page.getByTestId("tag-dates").count()).toBe(2);
});

test("change datetime field visibility works", async ({
Expand All @@ -100,30 +95,17 @@ test.describe("date field and date time field can filter visibility", () => {
page,
}) => {
await sidebar.toggleSidebarMode();

// collapse metadata group
await sidebar.toggleSidebarGroup("METADATA");

// mount eventListener
const gridRefreshedEventPromise =
eventUtils.getEventReceivedPromiseForPredicate(
"re-render-tag",
() => true
);
const entryExpandPromise = eventUtils.getEventReceivedPromiseForPredicate(
"animation-onRest",
() => true
);

await sidebar.clickFieldDropdown("seconds");
await sidebar.clickFieldCheckbox("seconds");
await sidebar.clickFieldDropdown("seconds");
await entryExpandPromise;

expect(await page.getByTestId("tag-seconds").count()).toBe(2);

await sidebar.changeSliderStartValue("seconds", "59.000", "0.000");
await gridRefreshedEventPromise;
// check screenshot
expect(await page.getByTestId("tag-seconds").count()).toBe(1);
});
});

0 comments on commit cb4c614

Please sign in to comment.