Skip to content

Commit 407a601

Browse files
Add some fixes for userContext and test server
1 parent 65f5801 commit 407a601

19 files changed

+35
-87
lines changed

.mocharc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ require:
88
- test/test.mocha.env
99
reporter: mocha-multi-reporters
1010
reporter-option:
11-
- configFile=mocha-multi-reporters.json
11+
- configFile=mocha-multi-reporters.json

mocha-multi-reporters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"mochawesomeReporterOptions": {
77
"reportDir": "test_report/mochawesome"
88
}
9-
}
9+
}

test/end-to-end/emailverification.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ describe("Email Verification", () => {
618618
const title = await getTextByDataSupertokens(page, "headerTitle");
619619
assert.deepStrictEqual(title, "Email verification successful!");
620620
await submitForm(page);
621-
// Make sure to wait for status to update. Flakes in headless.
621+
// Make sure to wait for status to update. Flakes in headless.
622622
await new Promise((r) => setTimeout(r, 500));
623623
const logoutButton = await getLogoutButton(page);
624624
await Promise.all([logoutButton.click(), page.waitForNavigation({ waitUntil: "networkidle0" })]);

test/end-to-end/mfa.factorscreen.otp.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@ import {
3333
backendHook,
3434
setupST,
3535
} from "../helpers";
36-
import {
37-
CONSUME_CODE_API,
38-
CREATE_CODE_API,
39-
MFA_INFO_API,
40-
SOMETHING_WENT_WRONG_ERROR,
41-
} from "../constants";
36+
import { CONSUME_CODE_API, CREATE_CODE_API, MFA_INFO_API, SOMETHING_WENT_WRONG_ERROR } from "../constants";
4237

4338
import { TEST_CLIENT_BASE_URL } from "../constants";
4439
import { getTestPhoneNumber } from "../exampleTestHelpers";

test/end-to-end/mfa.factorscreen.totp.test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
setupBrowser,
3030
backendHook,
3131
setupCoreApp,
32-
setupST
32+
setupST,
3333
} from "../helpers";
3434
import { CREATE_TOTP_DEVICE_API, MFA_INFO_API } from "../constants";
3535

@@ -115,7 +115,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
115115
...appConfig,
116116
mfaInfo: {
117117
allowedToSetup: ["totp"],
118-
}
118+
},
119119
});
120120
page = await browser.newPage();
121121

@@ -146,7 +146,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
146146
requirements: [],
147147
alreadySetup: [factorId],
148148
allowedToSetup: [factorId],
149-
}
149+
},
150150
});
151151

152152
await tryEmailPasswordSignIn(page, email);
@@ -172,7 +172,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
172172
requirements: [],
173173
alreadySetup: [factorId],
174174
allowedToSetup: [],
175-
}
175+
},
176176
});
177177

178178
await tryEmailPasswordSignIn(page, email);
@@ -192,7 +192,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
192192
requirements: [factorId],
193193
alreadySetup: [],
194194
allowedToSetup: [],
195-
}
195+
},
196196
});
197197

198198
await tryEmailPasswordSignIn(page, email);
@@ -211,7 +211,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
211211
requirements: [factorId],
212212
alreadySetup: [factorId],
213213
allowedToSetup: [],
214-
}
214+
},
215215
});
216216

217217
await tryEmailPasswordSignIn(page, email);
@@ -245,7 +245,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
245245
requirements: [factorId],
246246
alreadySetup: [factorId],
247247
allowedToSetup: [],
248-
}
248+
},
249249
});
250250

251251
await tryEmailPasswordSignIn(page, email);
@@ -262,7 +262,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
262262
requirements: [factorId],
263263
alreadySetup: [factorId],
264264
allowedToSetup: [],
265-
}
265+
},
266266
});
267267

268268
await tryEmailPasswordSignIn(page, email);
@@ -304,7 +304,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
304304
requirements: [factorId],
305305
alreadySetup: [],
306306
allowedToSetup: [factorId],
307-
}
307+
},
308308
});
309309

310310
await page.setRequestInterception(true);
@@ -341,7 +341,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
341341
requirements: [],
342342
alreadySetup: [factorId],
343343
allowedToSetup: [],
344-
}
344+
},
345345
});
346346

347347
await tryEmailPasswordSignIn(page, email);
@@ -360,7 +360,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
360360
requirements: [],
361361
alreadySetup: [factorId],
362362
allowedToSetup: [factorId],
363-
}
363+
},
364364
});
365365

366366
await tryEmailPasswordSignIn(page, email);
@@ -381,7 +381,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
381381
requirements: [],
382382
alreadySetup: [],
383383
allowedToSetup: [factorId],
384-
}
384+
},
385385
});
386386

387387
await tryEmailPasswordSignIn(page, email);
@@ -402,7 +402,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
402402
requirements: [],
403403
alreadySetup: [factorId],
404404
allowedToSetup: [],
405-
}
405+
},
406406
});
407407

408408
await tryEmailPasswordSignIn(page, email);
@@ -423,7 +423,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
423423
requirements: [{ oneOf: [factorId, "otp-email"] }],
424424
alreadySetup: ["otp-email"],
425425
allowedToSetup: [factorId],
426-
}
426+
},
427427
});
428428

429429
await tryEmailPasswordSignIn(page, email);
@@ -445,7 +445,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
445445
requirements: [{ oneOf: [factorId, "otp-email"] }],
446446
alreadySetup: [factorId, "otp-email"],
447447
allowedToSetup: [],
448-
}
448+
},
449449
});
450450

451451
await tryEmailPasswordSignIn(page, email);
@@ -466,7 +466,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
466466
requirements: [factorId],
467467
alreadySetup: [],
468468
allowedToSetup: [factorId],
469-
}
469+
},
470470
});
471471

472472
await tryEmailPasswordSignIn(page, email);
@@ -488,7 +488,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
488488
requirements: [factorId],
489489
alreadySetup: [factorId],
490490
allowedToSetup: [],
491-
}
491+
},
492492
});
493493

494494
await tryEmailPasswordSignIn(page, email);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
setupBrowser,
2828
backendHook,
2929
setupCoreApp,
30-
setupST
30+
setupST,
3131
} from "../helpers";
3232
import { TEST_CLIENT_BASE_URL } from "../constants";
3333
import { getTestPhoneNumber } from "../exampleTestHelpers";
@@ -135,7 +135,6 @@ describe("SuperTokens SignIn w/ MFA", function () {
135135

136136
describe("multistep requirement list", () => {
137137
it("multistep requirements should happen in order (allOfInAnyOrder -> oneOf)", async () => {
138-
139138
appConfig.mfaInfo = {
140139
requirements: [{ allOfInAnyOrder: ["otp-phone", "totp"] }, { oneOf: ["otp-email"] }],
141140
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
8989
consoleLogs.push(log);
9090
}
9191
});
92-
92+
9393
consoleLogs = await clearBrowserCookiesWithoutAffectingConsole(page, []);
9494

9595
await page.evaluate(() => window.localStorage.removeItem("supertokens-passwordless-loginAttemptInfo"));
@@ -117,7 +117,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
117117
...appConfig,
118118
mfaInfo: {
119119
requirements: ["otp-email"],
120-
}
120+
},
121121
});
122122

123123
await tryEmailPasswordSignUp(page, email);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe("SuperTokens Multitenancy tenant interactions", function () {
7878

7979
beforeEach(async function () {
8080
await backendHook("beforeEach");
81-
81+
8282
const coreUrl = await setupCoreApp();
8383
appConfig.coreUrl = coreUrl;
8484
await setupST(appConfig);

test/end-to-end/oauth2provider.test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ import {
4343
setupCoreApp,
4444
setupST,
4545
} from "../helpers";
46-
import {
47-
TEST_CLIENT_BASE_URL,
48-
TEST_APPLICATION_SERVER_BASE_URL,
49-
SOMETHING_WENT_WRONG_ERROR,
50-
} from "../constants";
46+
import { TEST_CLIENT_BASE_URL, TEST_APPLICATION_SERVER_BASE_URL, SOMETHING_WENT_WRONG_ERROR } from "../constants";
5147

5248
// We do no thave to use a separate domain for the oauth2 client, since the way we are testing
5349
// the lib doesn't interact with the supertokens session handling.

test/end-to-end/passwordless.test_gen.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ export function getPasswordlessTestCases({ authRecipe, logId, generalErrorRecipe
351351
});
352352
});
353353

354-
355354
describe(`UserInputCode`, function () {
356355
this.timeout(60000);
357356

0 commit comments

Comments
 (0)