Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Jul 7, 2024
1 parent a29c6a4 commit b47abc2
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/app/setUpSite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ test("correctly load the city score card", async ({ page }) => {
await page.click('.choices__item--choice >> text="Albany, NY"');
await page.waitForFunction(() => {
const titleElement = document.querySelector(".scorecard-title");
return titleElement && titleElement.textContent === "Albany, NY";
return (
titleElement && titleElement.textContent === "Parking lots in Albany, NY"
);
});

await page.locator(".scorecard-accordion-toggle").click();
Expand Down Expand Up @@ -105,7 +107,10 @@ test.describe("the share feature", () => {
await page.click('.choices__item--choice >> text="Anchorage, AK"');
await page.waitForFunction(() => {
const titleElement = document.querySelector(".scorecard-title");
return titleElement && titleElement.textContent === "Anchorage, AK";
return (
titleElement &&
titleElement.textContent === "Parking lots in Anchorage, AK"
);
});

await page.click(".header-share-icon-container");
Expand Down Expand Up @@ -134,7 +139,7 @@ test.describe("the share feature", () => {
return [title, cityToggle];
});

expect(scoreCardTitle).toEqual("Fort Worth, TX");
expect(scoreCardTitle).toEqual("Parking lots in Fort Worth, TX");
expect(cityToggleValue).toEqual("fort-worth-tx");
});

Expand All @@ -156,7 +161,7 @@ test.describe("the share feature", () => {
return [title, cityToggle];
});

expect(scoreCardTitle).toEqual("Atlanta, GA");
expect(scoreCardTitle).toEqual("Parking lots in Atlanta, GA");
expect(cityToggleValue).toEqual("atlanta-ga");
});
});
Expand Down Expand Up @@ -202,7 +207,7 @@ test.describe("auto-focus city", () => {
const newScorecard = await page
.locator(".scorecard-title")
.evaluate((node) => node.textContent);
expect(newScorecard).toEqual("Birmingham, AL");
expect(newScorecard).toEqual("Parking lots in Birmingham, AL");
expect(await page.isVisible("#birmingham-al")).toBe(true);
});
test("clicking on city boundary wide view", async ({ page }) => {
Expand All @@ -225,7 +230,7 @@ test.describe("auto-focus city", () => {
const scorecard = await page
.locator(".scorecard-title")
.evaluate((node) => node.textContent);
expect(scorecard).toEqual("Atlanta, GA");
expect(scorecard).toEqual("Parking lots in Atlanta, GA");
});
});

Expand All @@ -250,7 +255,7 @@ test("scorecard pulls up city closest to center", async ({ page }) => {
document.querySelector("#city-dropdown");
return [title, cityChoice?.value];
});
expect(scoreCardTitle).toEqual("Birmingham, AL");
expect(scoreCardTitle).toEqual("Parking lots in Birmingham, AL");
expect(cityToggleValue).toEqual("birmingham-al");
});

Expand Down

0 comments on commit b47abc2

Please sign in to comment.