From 2d4111c88ac8dae9128f8a46a3303a64b706c37a Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Thu, 4 Jul 2024 12:02:04 +0530 Subject: [PATCH] fix: tests --- test/cross.auto_refresh.test.js | 4 ++-- test/interception.basic1.test.js | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/cross.auto_refresh.test.js b/test/cross.auto_refresh.test.js index 2b0ebf2d..65001c8d 100644 --- a/test/cross.auto_refresh.test.js +++ b/test/cross.auto_refresh.test.js @@ -896,12 +896,12 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => { assert( consoleLogs.includes( - "Saving to cookies was not successful, this indicates a configuration error or the browser preventing us from writing the cookies (e.g.: incognito mode)." + "Saving to cookies was not successful, this indicates a configuration error or the browser preventing us from writing the cookies." ) ); assert( consoleLogs.includes( - "Failed to retrieve local session state from cookies after a successful session refresh. This indicates a configuration error or that the browser is preventing cookie writes (e.g., incognito mode)." + "Failed to retrieve local session state from cookies after a successful session refresh. This indicates a configuration error or that the browser is preventing cookie writes." ) ); }); diff --git a/test/interception.basic1.test.js b/test/interception.basic1.test.js index c2db9207..587d122a 100644 --- a/test/interception.basic1.test.js +++ b/test/interception.basic1.test.js @@ -280,13 +280,18 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => { assert( logs.some(str => str.includes( - "Saving to cookies was not successful, this indicates a configuration error or the browser preventing us from writing the cookies (e.g.: incognito mode)." + "Saving to cookies was not successful, this indicates a configuration error or the browser preventing us from writing the cookies." ) ) ); const cookies = await page.cookies(); - assert.strictEqual(cookies.length, 0); + // Assert that none of the frontend cookies are set + const frontendCookies = + transferMethod === "cookie" + ? ["sAntiCsrf", "sFrontToken", "st-last-access-token-update"] + : ["sFrontToken", "st-last-access-token-update", "st-access-token", "st-refresh-token"]; + assert(frontendCookies.every(cookieName => !cookies.find(cookie => cookie.name === cookieName))); }); it("test rid is there", async function () {