Skip to content

Commit

Permalink
Fix flaky e2e preferences test
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Oct 18, 2024
1 parent 86b17a5 commit cb3f54a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/pages/preferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const doneHydrating = computed(() => useHydrating())
@change="handleChange"
>
<div>
<strong>{{ flag.name }}</strong>
<strong>{{ flag.name }}{{ ` : ${flag.state}` }}</strong>
<br />
{{ flag.description }}
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/test/playwright/e2e/preferences.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Page, test } from "@playwright/test"
import { type Page, expect, test } from "@playwright/test"

import { preparePageForTests } from "~~/test/playwright/utils/navigation"

Expand Down Expand Up @@ -104,6 +104,8 @@ const toggleChecked = async (
},
[name, !originalChecked ? "bg-tertiary" : "bg-default"] as const
)
const textRe = new RegExp(`${name}: ${!originalChecked ? "on" : "off"}`)
await expect(page.getByText(textRe).first()).toBeVisible()
}

test.describe("switchable features", () => {
Expand Down

0 comments on commit cb3f54a

Please sign in to comment.