Skip to content

Commit 49cc51a

Browse files
Fix all tests to make them compatible with unified core setup
1 parent 61596c7 commit 49cc51a

14 files changed

+122
-37
lines changed

test/end-to-end/generalerror.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* Imports
1818
*/
1919
import assert from "assert";
20-
import puppeteer from "puppeteer";
21-
import fetch from "isomorphic-fetch";
2220
import {
2321
clearBrowserCookiesWithoutAffectingConsole,
2422
screenshotOnFailure,

test/end-to-end/mfa.chooserscreen.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,15 @@ describe("SuperTokens SignIn w/ MFA", function () {
7474
backendHook("before");
7575
const coreUrl = await setupCoreApp();
7676
appConfig.coreUrl = coreUrl;
77+
appConfig.accountLinkingConfig = {
78+
enabled: true,
79+
shouldAutoLink: {
80+
shouldAutomaticallyLink: true,
81+
shouldRequireVerification: false,
82+
},
83+
};
7784
await setupST(appConfig);
7885

79-
await setAccountLinkingConfig(true, true, false);
8086
browser = await setupBrowser();
8187
});
8288

test/end-to-end/mfa.default_reqs.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ describe("SuperTokens SignIn w/ MFA", function () {
6666
this.skip();
6767
}
6868

69-
await setAccountLinkingConfig(true, true, false);
7069
await backendHook("before");
7170
browser = await setupBrowser();
7271
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
setupCoreApp,
4141
setupST,
4242
backendHook,
43+
setupBrowser,
4344
} from "../helpers";
4445
import {
4546
TEST_CLIENT_BASE_URL,

test/end-to-end/refresherrors.test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ describe("Refresh errors", function () {
3131
let page;
3232

3333
before(async function () {
34-
browser = await puppeteer.launch({
35-
args: ["--no-sandbox", "--disable-setuid-sandbox"],
36-
headless: true,
37-
});
34+
browser = await setupBrowser();
3835
});
3936

4037
after(async function () {

test/end-to-end/routing.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
clearBrowserCookiesWithoutAffectingConsole,
3030
screenshotOnFailure,
3131
waitForUrl,
32+
setupBrowser,
3233
} from "../helpers";
3334
/*
3435
* Tests.
@@ -37,10 +38,7 @@ describe("SuperTokens Routing in Test App", function () {
3738
let browser, page;
3839

3940
before(async function () {
40-
browser = await puppeteer.launch({
41-
args: ["--no-sandbox", "--disable-setuid-sandbox"],
42-
headless: true,
43-
});
41+
browser = await setupBrowser();
4442
page = await browser.newPage();
4543
});
4644

test/end-to-end/signup.test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ describe("SuperTokens SignUp", function () {
6161
const coreUrl = await setupCoreApp();
6262
await setupST({ coreUrl });
6363

64-
browser = await puppeteer.launch({
65-
args: ["--no-sandbox", "--disable-setuid-sandbox"],
66-
headless: true,
67-
});
64+
browser = await setupBrowser();
6865
page = await browser.newPage();
6966
page.on("console", (consoleObj) => {
7067
const log = consoleObj.text();

test/end-to-end/thirdparty.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
backendHook,
3333
setupCoreApp,
3434
setupST,
35+
setupBrowser,
3536
} from "../helpers";
3637
import { TEST_CLIENT_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants";
3738

@@ -56,10 +57,7 @@ export function getThirdPartyTestCases({ authRecipe, rid, signInUpPageLoadLogs,
5657
const coreUrl = await setupCoreApp();
5758
await setupST({ coreUrl });
5859

59-
browser = await puppeteer.launch({
60-
args: ["--no-sandbox", "--disable-setuid-sandbox"],
61-
headless: true,
62-
});
60+
browser = await setupBrowser();
6361
page = await browser.newPage();
6462
page.on("console", (consoleObj) => {
6563
const log = consoleObj.text();

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ describe("SuperTokens Third Party Email Password", function () {
7676
appConfig.coreUrl = coreUrl;
7777
await setupST(appConfig);
7878

79-
browser = await puppeteer.launch({
80-
args: ["--no-sandbox", "--disable-setuid-sandbox"],
81-
headless: true,
82-
});
79+
browser = await setupBrowser();
8380
page = await browser.newPage();
8481
page.on("console", (consoleObj) => {
8582
const log = consoleObj.text();

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,7 @@ describe("SuperTokens Third Party Passwordless", function () {
7272
appConfig.coreUrl = coreUrl;
7373
await setupST(appConfig);
7474

75-
browser = await puppeteer.launch({
76-
args: ["--no-sandbox", "--disable-setuid-sandbox"],
77-
headless: true,
78-
});
75+
browser = await setupBrowser();
7976
page = await browser.newPage();
8077
page.on("console", (consoleObj) => {
8178
const log = consoleObj.text();

0 commit comments

Comments
 (0)