Skip to content

Commit

Permalink
Add signin form fields with default value for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amitbadala committed Nov 2, 2023
1 parent fa3b6f7 commit c5ee75c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/for-tests/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,25 @@ function getFormFields() {
return formFields;
}

function getSignInFormFields() {
let showDefaultFields = localStorage.getItem("SHOW_SIGNIN_DEFAULT_FIELDS");
if (showDefaultFields === "YES") {
return {
formFields: [
{
id: "email",
getDefaultValue: () => "[email protected]",
},
{
id: "password",
getDefaultValue: () => "fakepassword123",
},
],
};
}
return {};
}

function getEmailPasswordConfigs({ disableDefaultUI }) {
return EmailPassword.init({
style: `
Expand Down Expand Up @@ -801,6 +820,7 @@ function getEmailPasswordConfigs({ disableDefaultUI }) {
defaultToSignUp,
signInForm: {
style: theme,
...getSignInFormFields(),
},
signUpForm: {
style: theme,
Expand Down

0 comments on commit c5ee75c

Please sign in to comment.