diff --git a/e2e/specs/mock/scenarios/theme-paint.spec.ts b/e2e/specs/mock/scenarios/theme-paint.spec.ts index 150ad5faed..c47447bef6 100644 --- a/e2e/specs/mock/scenarios/theme-paint.spec.ts +++ b/e2e/specs/mock/scenarios/theme-paint.spec.ts @@ -152,6 +152,16 @@ function paintRoles(page: Page) { const rgb = (channels: string | undefined) => `rgb(${(channels ?? '').split(' ').join(', ')})`; test.describe('controlled theme paint', () => { + /** + * The app asks for `/api/config` again once the session resolves, and that request can still be + * inside a `serveThemes` handler when a test body returns. Closing the context under it disposes + * the fetched response, which fails the finished test from the handler, so each test lets its + * handlers settle first. + */ + test.afterEach(async ({ page }) => { + await page.unrouteAll({ behavior: 'wait' }); + }); + test("a shared link's first frame of the conversation already wears the link tenant's theme @scenario:shared-link-first-frame-wears-link-theme", async ({ page, }) => {