Skip to content

Commit

Permalink
Revert "Add tests for resetPassword email field"
Browse files Browse the repository at this point in the history
This reverts commit 363b575.
  • Loading branch information
amitbadala committed Nov 7, 2023
1 parent 363b575 commit ab38c3f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
15 changes: 3 additions & 12 deletions examples/for-tests/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,17 +740,6 @@ function getSignInFormFields() {
return {};
}

function emailFormForResetPassword() {
let showDefaultFields = localStorage.getItem("SHOW_DEFAULT_EMAIL_FOR_RESET_PASSWORD");
if (showDefaultFields === "YES") {
return {
getDefaultValue: () => "[email protected]",
style: theme,
};
}
return { style: theme };
}

function getEmailPasswordConfigs({ disableDefaultUI }) {
return EmailPassword.init({
style: `
Expand Down Expand Up @@ -819,7 +808,9 @@ function getEmailPasswordConfigs({ disableDefaultUI }) {
useShadowDom,
resetPasswordUsingTokenFeature: {
disableDefaultUI,
enterEmailForm: emailFormForResetPassword(),
enterEmailForm: {
style: theme,
},
submitNewPasswordForm: {
style: theme,
},
Expand Down
17 changes: 1 addition & 16 deletions test/end-to-end/resetpasswordusingtoken.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ import {
toggleSignInSignUp,
defaultSignUp,
screenshotOnFailure,
getAuthPageHeaderText,
getResetPasswordFormBackButton,
waitForSTElement,
getResetPasswordSuccessBackToSignInButton,
backendBeforeEach,
getInputField,
} from "../helpers";

/*
Expand Down Expand Up @@ -232,21 +232,6 @@ describe("SuperTokens Reset password", function () {
const buttonLabel = await getSubmitFormButtonLabel(page);
assert.deepStrictEqual(buttonLabel, "SIGN IN");
});

it("Should show default values for email field", async function () {
await page.evaluate(() => window.localStorage.setItem("SHOW_DEFAULT_EMAIL_FOR_RESET_PASSWORD", "YES"));

await page.reload({
waitUntil: "domcontentloaded",
});

const expectedDefaultEmail = "[email protected]";

const emailInput = await getInputField(page, "email");
const defaultEmail = await emailInput.evaluate((f) => f.value);

assert.strictEqual(defaultEmail, expectedDefaultEmail);
});
});

describe("Reset password new password form test", function () {
Expand Down
1 change: 0 additions & 1 deletion test/with-typescript/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ function getEmailPasswordConfigs() {
return EmailPassword.init({
resetPasswordUsingTokenFeature: {
enterEmailForm: {
getDefaultValue: () => "[email protected]",
style: theme.style,
},
submitNewPasswordForm: {
Expand Down

0 comments on commit ab38c3f

Please sign in to comment.