Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove focused playwright test so all tests run; fix broken tests #2194

Merged
merged 5 commits into from
May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions frontend/test/playwright/e2e/all-results-keyboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.describe("all results grid keyboard accessibility test", () => {
)
})

test.only("should open audio results as links", async ({ page }) => {
test("should open audio results as links", async ({ page }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh dear.

We should add an ESLint restricted syntax rule to prevent this from happening.

{
  "selector":  "CallExpression > MemberExpression:matches([object.name=/(test|it|describe)/], [object.object.name=/(test|it|describe)/])[property.name='only']",
  "message": "Do not commit .only"
}
{
  "selector": "CallExpression > MemberExpression[object.object.name='it'][object.property.name='only']",
  "message": "Do not commit .only"
}

That appears to work when I test it locally for *.only, *.only.each and *.concurrently.only which are all the iterations I could find on the jest documentation.

await walkToType("audio", page)
await page.keyboard.press("Enter")
await page.waitForURL(
Expand All @@ -83,8 +83,13 @@ test.describe("all results grid keyboard accessibility test", () => {
const focusedResult = await locateFocusedResult(page)
const playButton = await audio.getInactive(focusedResult)
await playButton.click()

// Get the path for comparison purposes
const url = new URL(page.url())
const path = url.pathname + url.search

// should not navigate
expect(page.url()).toMatch(/\/search\?q=birds$/)
expect(path).toMatch(/\/search\/?\?q=birds$/)

const pauseButton = await audio.getActive(focusedResult)
pauseButton.click()
Expand Down