Skip to content

Commit 2c20e27

Browse files
JohnMcLearclaude
andcommitted
test: address Qodo review — clear cookies on the page's own context (#7900)
browser.newContext()+clearCookies() cleared cookies on a throwaway context (not the page fixture under test) and leaked the context. Use page.context().clearCookies() so the regression test reliably starts without a stale rtlIsTrue pref. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ed647ae commit 2c20e27

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/tests/frontend-new/specs/rtl_pad_wide_enforce.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ import {showSettings} from "../helper/settingsHelper";
1515
// Fix: changePadViewOption syncs the creator's personal pref to the value they
1616
// chose, so their own view adopts the pad-wide setting immediately (while still
1717
// allowing them to override it afterwards via the "My view" controls).
18-
test.beforeEach(async ({page, browser}) => {
19-
const context = await browser.newContext();
20-
await context.clearCookies();
18+
test.beforeEach(async ({page}) => {
19+
// Clear cookies on the context of the page under test (not a throwaway
20+
// context) so the test reliably starts without a stale rtlIsTrue pref.
21+
await page.context().clearCookies();
2122
await goToNewPad(page);
2223
});
2324

0 commit comments

Comments
 (0)