From 5c45bd5b10194b6f5655485dfee4cd47e768d4fc Mon Sep 17 00:00:00 2001 From: Dhiraj Kumar Date: Sun, 10 Sep 2023 00:13:02 +0530 Subject: [PATCH] Fix ui tests --- .../time-controls/ComparisonSelector.svelte | 2 +- web-local/test/ui/dashboards.spec.ts | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/web-common/src/features/dashboards/time-controls/ComparisonSelector.svelte b/web-common/src/features/dashboards/time-controls/ComparisonSelector.svelte index 289db8c695c..258955b5ab4 100644 --- a/web-common/src/features/dashboards/time-controls/ComparisonSelector.svelte +++ b/web-common/src/features/dashboards/time-controls/ComparisonSelector.svelte @@ -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" > { 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(); /* @@ -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 () => {