Skip to content

Commit fc84b15

Browse files
authored
test: removed obsolete test (#191)
1 parent 5d6d585 commit fc84b15

File tree

2 files changed

+2
-81
lines changed

2 files changed

+2
-81
lines changed

test/axios.test.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,49 +1341,6 @@ describe("Axios AuthHttpRequest class tests", function () {
13411341
}
13421342
});
13431343

1344-
// - Interception should not happen when domain is not the one that they gave*******
1345-
it("test interception should not happen when domain is not the one that they gave", async function () {
1346-
await startST(5);
1347-
AuthHttpRequest.init({
1348-
apiDomain: BASE_URL
1349-
});
1350-
1351-
await axios.get(`https://www.google.com`);
1352-
let verifyRequestState = await ProcessState.getInstance().waitForEvent(
1353-
PROCESS_STATE.CALLING_INTERCEPTION_REQUEST,
1354-
100
1355-
);
1356-
let verifyResponseState = await ProcessState.getInstance().waitForEvent(
1357-
PROCESS_STATE.CALLING_INTERCEPTION_RESPONSE,
1358-
100
1359-
);
1360-
1361-
assert.strictEqual(verifyRequestState, undefined);
1362-
assert.strictEqual(verifyResponseState, undefined);
1363-
1364-
let userId = "testing-supertokens-website";
1365-
let loginResponse = await axios.post(`${BASE_URL}/login`, JSON.stringify({ userId }), {
1366-
headers: {
1367-
Accept: "application/json",
1368-
"Content-Type": "application/json"
1369-
}
1370-
});
1371-
1372-
assert.strictEqual(await loginResponse.data, userId);
1373-
1374-
verifyRequestState = await ProcessState.getInstance().waitForEvent(
1375-
PROCESS_STATE.CALLING_INTERCEPTION_REQUEST,
1376-
5000
1377-
);
1378-
verifyResponseState = await ProcessState.getInstance().waitForEvent(
1379-
PROCESS_STATE.CALLING_INTERCEPTION_RESPONSE,
1380-
5000
1381-
);
1382-
1383-
assert.notStrictEqual(verifyRequestState, undefined);
1384-
assert.notStrictEqual(verifyResponseState, undefined);
1385-
});
1386-
13871344
it("test with axios interception should happen if api domain and website domain are the same and relative path is used", async function () {
13881345
await startST(5);
13891346

test/interception.basic1.test.js

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)