Skip to content

Commit 78bd022

Browse files
committed
removes usages of old helper functions
1 parent fb4f00b commit 78bd022

File tree

5 files changed

+14
-47
lines changed

5 files changed

+14
-47
lines changed

test/end-to-end/getRedirectionURL.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
import assert from "assert";
2-
import fetch from "isomorphic-fetch";
3-
import puppeteer from "puppeteer";
42
import {
53
toggleSignInSignUp,
64
defaultSignUp,
75
screenshotOnFailure,
86
assertProviders,
97
clickOnProviderButton,
108
loginWithAuth0,
11-
setPasswordlessFlowType,
129
waitForSTElement,
1310
getPasswordlessDevice,
1411
setInputValues,
1512
submitForm,
1613
clearBrowserCookiesWithoutAffectingConsole,
1714
isPasswordlessSupported,
1815
isThirdPartyPasswordlessSupported,
19-
backendBeforeEach,
2016
setupBrowser,
2117
backendHook,
2218
setupCoreApp,

test/end-to-end/multitenancy.tenant_interactions.test.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
getSubmitFormButton,
3232
waitForSTElement,
3333
getPasswordlessDevice,
34-
setPasswordlessFlowType,
3534
getSessionHandleWithFetch,
3635
getLatestURLWithToken,
3736
sendEmailResetPasswordSuccessMessage,
@@ -65,6 +64,8 @@ describe("SuperTokens Multitenancy tenant interactions", function () {
6564
let page;
6665
let pageCrashed;
6766

67+
const appConfig = {};
68+
6869
before(async function () {
6970
await backendHook("before");
7071
const isSupported = (await isMultitenancySupported()) && (await isMultitenancyManagementEndpointsSupported());
@@ -79,7 +80,8 @@ describe("SuperTokens Multitenancy tenant interactions", function () {
7980
await backendHook("beforeEach");
8081

8182
const coreUrl = await setupCoreApp();
82-
await setupST({ coreUrl });
83+
appConfig.coreUrl = coreUrl;
84+
await setupST(appConfig);
8385

8486
page = await browser.newPage();
8587

@@ -676,7 +678,11 @@ describe("SuperTokens Multitenancy tenant interactions", function () {
676678
});
677679

678680
it("should revoke magic links on removed tenants", async function () {
679-
await setPasswordlessFlowType("EMAIL_OR_PHONE", "USER_INPUT_CODE_AND_MAGIC_LINK");
681+
await setupST({
682+
...appConfig,
683+
passwordlessContactMethod: "EMAIL_OR_PHONE",
684+
passwordlessFlowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
685+
});
680686
await setEnabledRecipes(page, ["passwordless"]);
681687
await setupTenant("customer1", {
682688
emailPassword: { enabled: false },
@@ -719,7 +725,11 @@ describe("SuperTokens Multitenancy tenant interactions", function () {
719725

720726
describe("passwordless sign in", () => {
721727
beforeEach(async () => {
722-
await setPasswordlessFlowType("EMAIL_OR_PHONE", "USER_INPUT_CODE_AND_MAGIC_LINK");
728+
await setupST({
729+
...appConfig,
730+
passwordlessContactMethod: "EMAIL_OR_PHONE",
731+
passwordlessFlowType: "USER_INPUT_CODE_AND_MAGIC_LINK",
732+
});
723733
});
724734

725735
it("should work using OTP on the public tenants", async function () {

test/end-to-end/thirdpartyemailpassword.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
getFieldErrors,
4141
clickOnProviderButtonWithoutWaiting,
4242
getFeatureFlags,
43-
setEnabledRecipes,
4443
setSelectDropdownValue,
4544
getInputField,
4645
getLabelsText,

test/end-to-end/thirdpartypasswordless.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
getPasswordlessDevice,
3131
getFeatureFlags,
3232
assertProviders,
33-
setEnabledRecipes,
3433
clickOnProviderButtonWithoutWaiting,
3534
getGeneralError,
3635
waitForUrl,
@@ -223,7 +222,6 @@ describe("SuperTokens Third Party Passwordless", function () {
223222
enabledRecipes: ["thirdparty"],
224223
enabledProviders: [],
225224
});
226-
await setEnabledRecipes(["thirdparty"], []);
227225

228226
await Promise.all([
229227
page.waitForResponse(

test/helpers.js

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -921,31 +921,6 @@ export async function getPasswordlessDevice(loginAttemptInfo) {
921921
return await deviceResp.json();
922922
}
923923

924-
export function setPasswordlessFlowType(contactMethod, flowType) {
925-
return fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/test/setFlow`, {
926-
method: "POST",
927-
headers: [["content-type", "application/json"]],
928-
body: JSON.stringify({
929-
contactMethod,
930-
flowType,
931-
}),
932-
});
933-
}
934-
935-
export function setAccountLinkingConfig(enabled, shouldAutomaticallyLink, shouldRequireVerification) {
936-
return fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/test/setAccountLinkingConfig`, {
937-
method: "POST",
938-
headers: [["content-type", "application/json"]],
939-
body: JSON.stringify({
940-
enabled,
941-
shouldAutoLink: {
942-
shouldAutomaticallyLink,
943-
shouldRequireVerification,
944-
},
945-
}),
946-
});
947-
}
948-
949924
export function changeEmail(rid, recipeUserId, email, phoneNumber) {
950925
return fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/changeEmail`, {
951926
method: "POST",
@@ -959,17 +934,6 @@ export function changeEmail(rid, recipeUserId, email, phoneNumber) {
959934
});
960935
}
961936

962-
export function setEnabledRecipes(enabledRecipes, enabledProviders) {
963-
return fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/test/setEnabledRecipes`, {
964-
method: "POST",
965-
headers: [["content-type", "application/json"]],
966-
body: JSON.stringify({
967-
enabledRecipes,
968-
enabledProviders,
969-
}),
970-
});
971-
}
972-
973937
export function isReact16() {
974938
return process.env.IS_REACT_16 === "true";
975939
}

0 commit comments

Comments
 (0)