From 1d7b6d4c4880c199ffe2d22bcd71a06b074cdd5e Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Tue, 27 Aug 2024 18:40:45 +0530 Subject: [PATCH] fix: PR changes --- test/end-to-end/oauth2provider.test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/end-to-end/oauth2provider.test.js b/test/end-to-end/oauth2provider.test.js index f8a5e25cc..64a887e21 100644 --- a/test/end-to-end/oauth2provider.test.js +++ b/test/end-to-end/oauth2provider.test.js @@ -224,9 +224,10 @@ describe("SuperTokens OAuth2Provider", function () { await page.waitForSelector("#oauth2-token-data", { hidden: true }); - // Ensure supertokens session was cleared - const sessionInfoRes = await fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/sessioninfo`); - assert.strictEqual(sessionInfoRes.status, 401); + // Ensure that the SuperTokens session was cleared by checking for a redirect to the provider's auth page during the login flow. + loginButton = await getOAuth2LoginButton(page); + await loginButton.click(); + await waitForUrl(page, "/auth"); }); it("should login without interaction if the user already has a session", async function () {