Skip to content

Commit

Permalink
Fix ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
djbarnwal committed Sep 9, 2023
1 parent 05c0b26 commit 5c45bd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ This component needs to do the following:
slot="floating-element"
on:escape={toggleFloatingElement}
on:click-outside={toggleFloatingElement}
label="Time comparison selector"
label="Comparison selector"
>
<MenuItem
selected={!(showTimeComparison || selectedDimension)}
Expand Down
16 changes: 7 additions & 9 deletions web-local/test/ui/dashboards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,20 @@ test.describe("dashboard", () => {
expect(parquetRegex.test(downloadParquet.suggestedFilename())).toBe(true);

// Turn off comparison
await page.getByRole("button", { name: "Comparing by Time" }).click();
await page
.getByRole("button", { name: "Comparing to last period" })
.click();
await page
.getByLabel("Time comparison selector")
.getByRole("menuitem", { name: "no comparison" })
.getByLabel("Comparison selector")
.getByRole("menuitem", { name: "No comparison" })
.click();

// Check number
await expect(page.getByText("272", { exact: true })).toBeVisible();

// Add comparison back
await page.getByRole("button", { name: "no comparison" }).click();
await page.getByRole("button", { name: "No comparison" }).click();
await page
.getByLabel("Time comparison selector")
.getByRole("menuitem", { name: "last period" })
.getByLabel("Comparison selector")
.getByRole("menuitem", { name: "Time" })
.click();

/*
Expand All @@ -202,7 +200,7 @@ test.describe("dashboard", () => {
For now, we will wait for the menu to disappear before clicking the next menu
*/
await expect(page.getByLabel("Time comparison selector")).not.toBeVisible();
await expect(page.getByLabel("Comparison selector")).not.toBeVisible();

// Switch to a custom time range
await interactWithTimeRangeMenu(page, async () => {
Expand Down

0 comments on commit 5c45bd5

Please sign in to comment.