Skip to content

Commit 2623d7f

Browse files
fix: issues with some tests failing due to imports
1 parent e2e6b2d commit 2623d7f

File tree

2 files changed

+6
-55
lines changed

2 files changed

+6
-55
lines changed

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

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
} from "../helpers";
4141

4242
import { TEST_CLIENT_BASE_URL, SOMETHING_WENT_WRONG_ERROR } from "../constants";
43-
import { tryEmailPasswordSignUp, tryPasswordlessSignInUp } from "./mfa.helpers";
4443

4544
/*
4645
* Tests.
@@ -2196,56 +2195,6 @@ export function getPasswordlessTestCases({ authRecipe, logId, generalErrorRecipe
21962195
await waitForSTElement(page, "[data-supertokens~=input][name=userInputCode]");
21972196
});
21982197
});
2199-
2200-
if (authRecipe === "all") {
2201-
describe("with emailpassword combo", () => {
2202-
before(async function () {
2203-
await backendHook("before");
2204-
await setupST({
2205-
coreUrl,
2206-
passwordlessFlowType: "USER_INPUT_CODE",
2207-
passwordlessContactMethod: contactMethod,
2208-
});
2209-
({ browser, page } = await initBrowser(contactMethod, consoleLogs, authRecipe, undefined));
2210-
if (authRecipe === "all") {
2211-
await tryEmailPasswordSignUp(page, registeredEmailWithPass);
2212-
}
2213-
});
2214-
2215-
after(async function () {
2216-
await browser?.close();
2217-
await backendHook("after");
2218-
});
2219-
2220-
beforeEach(async function () {
2221-
await clearBrowserCookiesWithoutAffectingConsole(page, consoleLogs);
2222-
2223-
await page.evaluate(() => localStorage.removeItem("supertokens-passwordless-loginAttemptInfo"));
2224-
await page.evaluate(() => localStorage.removeItem("SHOW_GENERAL_ERROR"));
2225-
2226-
consoleLogs.length = 0;
2227-
});
2228-
2229-
it("should navigate to the sign in page when the user clicks on the forgot password link", async function () {
2230-
await page.goto(`${TEST_CLIENT_BASE_URL}/auth`);
2231-
2232-
await setInputValues(page, [{ name: "email", value: registeredEmailWithPass }]);
2233-
await submitForm(page);
2234-
2235-
const testVal = "nav check" + Date.now();
2236-
2237-
await page.evaluate((testVal) => {
2238-
window.testVal = testVal;
2239-
}, testVal);
2240-
2241-
await clickForgotPasswordLink(page);
2242-
await waitForUrl(page, "/auth/reset-password");
2243-
2244-
const testValAfterNav = await page.evaluate(() => window.testVal);
2245-
assert.strictEqual(testVal, testValAfterNav);
2246-
});
2247-
});
2248-
}
22492198
}
22502199
}
22512200

test/helpers.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,11 @@ export function getDefaultSignUpFieldValues({
657657
return { fieldValues, postValues };
658658
}
659659

660-
export async function signUp(page, fields, postValues = undefined, rid = "emailpassword") {
660+
export async function signUp(page, fields, postValues, rid = "emailpassword") {
661+
if (postValues === undefined) {
662+
postValues = JSON.stringify({ formFields: fields.map((v) => ({ id: v.name, value: v.value })) });
663+
}
664+
661665
// Set values.
662666
await setInputValues(page, fields);
663667
const successAdornments = await getInputAdornmentsSuccess(page);
@@ -674,9 +678,7 @@ export async function signUp(page, fields, postValues = undefined, rid = "emailp
674678
assert.strictEqual(hasEmailExistMethodBeenCalled, false);
675679

676680
assert.strictEqual(request.headers().rid, rid);
677-
if (postValues !== undefined) {
678-
assert.strictEqual(request.postData(), postValues);
679-
}
681+
assert.strictEqual(request.postData(), postValues);
680682

681683
assert.strictEqual(response.status, "OK");
682684
await page.setRequestInterception(false);

0 commit comments

Comments
 (0)