Skip to content

Commit d890f78

Browse files
fix: issues with some tests failing due to imports
1 parent 8fb39ce commit d890f78

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
@@ -43,7 +43,6 @@ import {
4343
} from "../helpers";
4444

4545
import { TEST_CLIENT_BASE_URL, SOMETHING_WENT_WRONG_ERROR } from "../constants";
46-
import { tryEmailPasswordSignUp, tryPasswordlessSignInUp } from "./mfa.helpers";
4746

4847
/*
4948
* Tests.
@@ -2104,56 +2103,6 @@ export function getPasswordlessTestCases({ authRecipe, logId, generalErrorRecipe
21042103
await waitForSTElement(page, "[data-supertokens~=input][name=userInputCode]");
21052104
});
21062105
});
2107-
2108-
if (authRecipe === "all") {
2109-
describe("with emailpassword combo", () => {
2110-
before(async function () {
2111-
await backendHook("before");
2112-
await setupST({
2113-
coreUrl,
2114-
passwordlessFlowType: "USER_INPUT_CODE",
2115-
passwordlessContactMethod: contactMethod,
2116-
});
2117-
({ browser, page } = await initBrowser(contactMethod, consoleLogs, authRecipe, undefined));
2118-
if (authRecipe === "all") {
2119-
await tryEmailPasswordSignUp(page, registeredEmailWithPass);
2120-
}
2121-
});
2122-
2123-
after(async function () {
2124-
await browser?.close();
2125-
await backendHook("after");
2126-
});
2127-
2128-
beforeEach(async function () {
2129-
await clearBrowserCookiesWithoutAffectingConsole(page, consoleLogs);
2130-
2131-
await page.evaluate(() => localStorage.removeItem("supertokens-passwordless-loginAttemptInfo"));
2132-
await page.evaluate(() => localStorage.removeItem("SHOW_GENERAL_ERROR"));
2133-
2134-
consoleLogs.length = 0;
2135-
});
2136-
2137-
it("should navigate to the sign in page when the user clicks on the forgot password link", async function () {
2138-
await page.goto(`${TEST_CLIENT_BASE_URL}/auth`);
2139-
2140-
await setInputValues(page, [{ name: "email", value: registeredEmailWithPass }]);
2141-
await submitForm(page);
2142-
2143-
const testVal = "nav check" + Date.now();
2144-
2145-
await page.evaluate((testVal) => {
2146-
window.testVal = testVal;
2147-
}, testVal);
2148-
2149-
await clickForgotPasswordLink(page);
2150-
await waitForUrl(page, "/auth/reset-password");
2151-
2152-
const testValAfterNav = await page.evaluate(() => window.testVal);
2153-
assert.strictEqual(testVal, testValAfterNav);
2154-
});
2155-
});
2156-
}
21572106
}
21582107
}
21592108

test/helpers.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,11 @@ export function getDefaultSignUpFieldValues({
652652
return { fieldValues, postValues };
653653
}
654654

655-
export async function signUp(page, fields, postValues = undefined, rid = "emailpassword") {
655+
export async function signUp(page, fields, postValues, rid = "emailpassword") {
656+
if (postValues === undefined) {
657+
postValues = JSON.stringify({ formFields: fields.map((v) => ({ id: v.name, value: v.value })) });
658+
}
659+
656660
// Set values.
657661
await setInputValues(page, fields);
658662
const successAdornments = await getInputAdornmentsSuccess(page);
@@ -669,9 +673,7 @@ export async function signUp(page, fields, postValues = undefined, rid = "emailp
669673
assert.strictEqual(hasEmailExistMethodBeenCalled, false);
670674

671675
assert.strictEqual(request.headers().rid, rid);
672-
if (postValues !== undefined) {
673-
assert.strictEqual(request.postData(), postValues);
674-
}
676+
assert.strictEqual(request.postData(), postValues);
675677

676678
assert.strictEqual(response.status, "OK");
677679
await page.setRequestInterception(false);

0 commit comments

Comments
 (0)