Skip to content

Commit

Permalink
fix: Temporal filter test broken
Browse files Browse the repository at this point in the history
Fixed by re-recording test, I suppose this was broken due to change to
a YearPicker
  • Loading branch information
ptbrowne committed Feb 22, 2024
1 parent a87c903 commit 49d469a
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions e2e/filters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,18 @@ describe("Filters", () => {
const productionRegionFilterValue = await productionRegionFilter
.locator("input[name^=select-single-filter]")
.inputValue();
expect(productionRegionFilterValue).toEqual(
"Switzerland"
);
expect(productionRegionFilterValue).toEqual("Switzerland");

const treeStatusFilter =
selectors.edition.dataFilterInput("2. tree status ");
const treeStatusFilterValue = await treeStatusFilter
.locator("input[name^=select-single-filter]")
.inputValue();

expect(treeStatusFilterValue).toEqual(
"Total"
);
expect(treeStatusFilterValue).toEqual("Total");
});

test("Temporal filter should display all values", async ({
test("Temporal filter should display values", async ({
page,
actions,
selectors,
Expand All @@ -66,17 +62,18 @@ describe("Filters", () => {
const filters = await selectors.edition.configFilters();

await filters.locator("label").first().waitFor({ timeout: 30_000 });

const labels = filters.locator("label[for^=select-single-filter]");

const texts = await labels.allTextContents();
expect(texts).toEqual(["1. Jahr der Vergütung"]);

const yearFilter = await within(filters).findByText("2014");
await yearFilter.click();

const options = await selectors.mui.options().allInnerTexts();

expect(options.length).toEqual(9);
await page
.getByRole("button", {
name: "Choose date, selected date is 1 Jan 2014",
exact: true,
})
.click();

for (let year of Array.from({ length: 9 })
.fill(null)
.map((_, i) => `${2014 + i}`)) {
await page.getByRole("button", { name: year, exact: true });
}
await page.getByRole("button", { name: "2014", exact: true }).click();
});
});

0 comments on commit 49d469a

Please sign in to comment.