Skip to content

Commit 81d7b38

Browse files
committed
Fix flaky E2E tests - update calls to avoid race condition in theme picker rehydration
1 parent 8b1209c commit 81d7b38

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎_TODO.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# TODO
22

3-
Ensured consent logging never sends malformed IDs by validating/regenerating DataSubjectId inside consent.ts. A new helper now runs on every consent change, fixes the state atom when needed, and uses the regenerated ID immediately so the /api/gdpr/consent payload always passes API validation (no more 400s/console noise on Mobile Safari).
4-
5-
Added regression coverage in consent.spec.ts: the existing happy-path test now uses a valid UUID, and a new test asserts we regenerate & persist a DataSubjectId when the store provides an empty/invalid value before logging.
6-
73
## Performance
84

95
Implement mitigations in test/e2e/specs/07-performance/PERFORMANCE.md

‎test/e2e/specs/04-components/theme-picker.spec.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ async function navigateWithMobileSupport(basePage: BasePage, href: string = getD
5959
// Trigger client-side navigation (Astro View Transitions)
6060
await basePage.navigateToPage(href)
6161
await basePage.waitForPageLoad()
62+
// Header components rehydrate asynchronously after View Transitions; make sure
63+
// the theme picker + navigation are ready before interacting again.
64+
await waitForHeaderComponents(page)
6265

6366
// On mobile, the menu should automatically close after navigation
6467
// But let's ensure it's closed by checking and closing if needed

0 commit comments

Comments
 (0)