@@ -1106,42 +1106,6 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
11061106 } ) ;
11071107 } ) ;
11081108
1109- // // - Interception should not happen when domain is not the one that they gave*******
1110- // it("test interception should not happen when domain is not the one that they gave", async function() {
1111- // await startST(5);
1112- // AuthHttpRequest.init({
1113- // apiDomain: BASE_URL,
1114- // });
1115- // let userId = "testing-supertokens-website";
1116-
1117- // // this is technically not doing interception, but it is equavalent to doing it since the inteceptor just calls the function below.
1118- // await toTest({ url: `https://www.google.com` });
1119-
1120- // let verifyRequestState = await ProcessState.getInstance().waitForEvent(
1121- // PROCESS_STATE.CALLING_INTERCEPTION_REQUEST,
1122- // 100,
1123- // );
1124-
1125- // assert.deepEqual(verifyRequestState, undefined);
1126-
1127- // let loginResponse = await toTest({ url: `${BASE_URL}/login`,
1128- // method: "post",
1129- // headers: {
1130- // Accept: "application/json",
1131- // "Content-Type": "application/json",
1132- // },
1133- // body: JSON.stringify({ userId }),
1134- // });
1135-
1136- // assert.deepEqual(loginResponse.responseText, userId);
1137-
1138- // verifyRequestState = await ProcessState.getInstance().waitForEvent(
1139- // PROCESS_STATE.CALLING_INTERCEPTION_REQUEST,
1140- // 5000,
1141- // );
1142- // assert.notDeepEqual(verifyRequestState, undefined);
1143- // });
1144-
11451109 it ( "test interception should happen if api domain and website domain are the same and relative path is used" , async function ( ) {
11461110 await startST ( 5 ) ;
11471111 await setup ( ) ;
@@ -1194,7 +1158,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
11941158
11951159 assert . strictEqual ( loginResponse . responseText , userId ) ;
11961160
1197- assert . strictEqual ( document . cookie , "" ) ;
1161+ assert . strictEqual ( await supertokens . doesSessionExist ( ) , false ) ;
11981162 } ) ;
11991163 } ) ;
12001164
@@ -1218,7 +1182,7 @@ addTestCases((name, transferMethod, setupFunc, setupArgs = []) => {
12181182
12191183 assert . strictEqual ( loginResponse . responseText , userId ) ;
12201184
1221- assert . strictEqual ( document . cookie , "" ) ;
1185+ assert . strictEqual ( await supertokens . doesSessionExist ( ) , false ) ;
12221186 } ) ;
12231187 } ) ;
12241188
0 commit comments