-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Part of #182 If there is no `contribution` tag in scorecard, the city is automatically labelled as an `Official Map`. Will add alert in a future PR. New render: ![image](https://github.com/ParkingReformNetwork/parking-lot-map/assets/86996158/f40631cc-25bf-46cb-8ca1-0e117f6f6ed6) ![image](https://github.com/ParkingReformNetwork/parking-lot-map/assets/86996158/8d4e6a5e-8f1b-43f9-9515-8ef234285a00) --------- Co-authored-by: tunglinn <[email protected]>
- Loading branch information
Showing
4 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test("there are exactly 103 official city maps", async ({ page }) => { | ||
await page.goto("/"); | ||
await page.waitForSelector(".choices"); | ||
const choices = await page.locator(".choices"); | ||
await choices.click(); | ||
await page.waitForSelector(".is-active"); | ||
|
||
const toggleValues = await page.$eval( | ||
".choices__list [role='listbox']", | ||
(element: HTMLElement) => | ||
Array.from(element.children).map( | ||
(child: Element) => (child as HTMLElement).innerText | ||
) | ||
); | ||
|
||
const communityMapIndex = toggleValues.indexOf("Community Maps"); | ||
// Consider removing if statement after first community map is implemented | ||
if (communityMapIndex > -1) { | ||
const officialMapIndex = | ||
communityMapIndex - toggleValues.indexOf("Official Maps"); | ||
expect(officialMapIndex).toEqual(103); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters