Skip to content

Commit c4c97d4

Browse files
fix: failing auth-react tests [0.47] (#896)
* fix: awaits `setupST` calls * Skip thirdpartyemailpassword if not enabled in backend * Revert "Skip thirdpartyemailpassword if not enabled in backend" This reverts commit 9802413. * fix: `after` hook page close failures --------- Co-authored-by: Deepjyoti Barman <[email protected]>
1 parent 93edcb8 commit c4c97d4

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { TEST_CLIENT_BASE_URL, SIGN_IN_UP_API } from "../constants";
2323

2424
describe("getRedirectionURL Tests", function () {
2525
let browser;
26-
let page;
2726

2827
before(async function () {
2928
await backendHook("before");
@@ -46,6 +45,8 @@ describe("getRedirectionURL Tests", function () {
4645

4746
describe("Test that isNewRecipeUser is passed correctly", function () {
4847
describe("Email Password Recipe", function () {
48+
let page;
49+
4950
beforeEach(async function () {
5051
page = await browser.newPage();
5152
const coreUrl = await setupCoreApp();
@@ -72,6 +73,8 @@ describe("getRedirectionURL Tests", function () {
7273
});
7374

7475
describe("Third party recipe", function () {
76+
let page;
77+
7578
before(async function () {
7679
const coreUrl = await setupCoreApp();
7780
await setupST({ coreUrl });
@@ -105,6 +108,8 @@ describe("getRedirectionURL Tests", function () {
105108
});
106109

107110
describe("Thirdpartyemailpassword recipe", function () {
111+
let page;
112+
108113
before(async function () {
109114
const coreUrl = await setupCoreApp();
110115
await setupST({ coreUrl });
@@ -145,6 +150,7 @@ describe("getRedirectionURL Tests", function () {
145150

146151
describe("Passwordless recipe", function () {
147152
const exampleEmail = "[email protected]";
153+
let page;
148154

149155
before(async function () {
150156
let _isPasswordlessSupported = await isPasswordlessSupported();
@@ -207,6 +213,7 @@ describe("getRedirectionURL Tests", function () {
207213

208214
describe("ThirdPartyPasswordless recipe", function () {
209215
const exampleEmail = "[email protected]";
216+
let page;
210217

211218
before(async function () {
212219
let _isThirdPartyPasswordlessSupported = await isThirdPartyPasswordlessSupported();
@@ -283,6 +290,8 @@ describe("getRedirectionURL Tests", function () {
283290

284291
describe("No Redirection", function () {
285292
describe("Email Password Recipe", function () {
293+
let page;
294+
286295
before(async function () {
287296
const coreUrl = await setupCoreApp();
288297
await setupST({ coreUrl });
@@ -320,6 +329,7 @@ describe("getRedirectionURL Tests", function () {
320329

321330
describe("Passwordless recipe", function () {
322331
const exampleEmail = "[email protected]";
332+
let page;
323333

324334
before(async function () {
325335
let _isPasswordlessSupported = await isPasswordlessSupported();
@@ -387,6 +397,7 @@ describe("getRedirectionURL Tests", function () {
387397

388398
describe("ThirdPartyPasswordless recipe: Magic Link", function () {
389399
const exampleEmail = "[email protected]";
400+
let page;
390401

391402
before(async function () {
392403
let _isThirdPartyPasswordlessSupported = await isThirdPartyPasswordlessSupported();
@@ -453,6 +464,7 @@ describe("getRedirectionURL Tests", function () {
453464
});
454465

455466
describe("ThirdParty Recipe", function () {
467+
let page;
456468
before(async function () {
457469
const coreUrl = await setupCoreApp();
458470
await setupST({ coreUrl });

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
113113
it("sign in with email-otp (auto-setup)", async function () {
114114
const email = await getTestEmail();
115115

116-
setupST({
116+
await setupST({
117117
...appConfig,
118118
mfaInfo: {
119119
requirements: ["otp-email"],
@@ -139,7 +139,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
139139
const email = await getTestEmail();
140140
const phoneNumber = getTestPhoneNumber();
141141

142-
setupST({
142+
await setupST({
143143
...appConfig,
144144
mfaInfo: {
145145
requirements: [{ oneOf: ["otp-email", "otp-phone"] }],
@@ -163,7 +163,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
163163
});
164164

165165
it("set up otp-email and sign-in", async function () {
166-
setupST({
166+
await setupST({
167167
...appConfig,
168168
mfaInfo: {
169169
requirements: [],
@@ -179,7 +179,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
179179

180180
await logout(page);
181181

182-
setupST({
182+
await setupST({
183183
...appConfig,
184184
mfaInfo: {
185185
requirements: [{ oneOf: ["otp-email"] }],
@@ -203,15 +203,15 @@ describe("SuperTokens SignIn w/ MFA", function () {
203203
});
204204

205205
it("set up totp and sign-in", async function () {
206-
setupST({
206+
await setupST({
207207
...appConfig,
208208
mfaInfo: {
209209
requirements: [],
210210
},
211211
});
212212
const email = await getTestEmail();
213213

214-
setupST({
214+
await setupST({
215215
...appConfig,
216216
mfaInfo: {
217217
requirements: [{ oneOf: ["otp-email", "totp"] }],
@@ -245,7 +245,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
245245

246246
it("should show access denied if the only next option is an unknown factor id", async () => {
247247
const email = await getTestEmail();
248-
setupST({
248+
await setupST({
249249
...appConfig,
250250
mfaInfo: {
251251
requirements: ["unknown"],
@@ -258,7 +258,7 @@ describe("SuperTokens SignIn w/ MFA", function () {
258258
});
259259

260260
it("should throw error if there are no valid next options", async () => {
261-
setupST({
261+
await setupST({
262262
...appConfig,
263263
mfaInfo: {
264264
requirements: ["unknown"],

0 commit comments

Comments
 (0)