Skip to content

Commit 5bddd0c

Browse files
committed
test(auth): fix signup snapshot flakiness and sign out selectors
Generated-by: aiautocommit
1 parent e0f1343 commit 5bddd0c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/integration/user_creation_test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def test_signup(server, page: Page, assert_snapshot) -> None:
4848
)
4949

5050
expect(page.locator("body")).to_contain_text("Hello From Internal Python")
51+
# Clerk UserButton loads async; wait so the masked region is stable for snapshots
52+
expect(page.locator('[data-clerk-component="UserButton"]')).to_be_visible()
5153

5254
assert_snapshot(page)
5355

@@ -58,9 +60,9 @@ def test_signup(server, page: Page, assert_snapshot) -> None:
5860
# user should be created at this point!
5961
assert User.count() == 1
6062

61-
# logout
62-
page.locator(".flex > div:nth-child(3)").first.click()
63-
page.get_by_role("menuitem", name="Sign out").click()
63+
# logout — Clerk UserButton popover actions are buttons, not menuitems
64+
page.locator('[data-clerk-component="UserButton"] button').click()
65+
page.get_by_role("button", name="Sign out").click()
6466

6567
expect(page.locator("body")).to_contain_text("Sign in")
6668

0 commit comments

Comments
 (0)