Skip to content

Commit

Permalink
test: fix enableMFA
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Dec 8, 2023
1 parent a47eda3 commit 35e54ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
9 changes: 6 additions & 3 deletions examples/for-tests-react-16/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,11 @@ if (emailVerificationMode !== "OFF") {
}

if (testContext.enableMFA) {
MultiFactorAuth.init({
firstFactors: testContext.firstFactors,
});
recipeList.push(
MultiFactorAuth.init({
firstFactors: testContext.firstFactors,
})
);
}

SuperTokens.init({
Expand Down Expand Up @@ -520,6 +522,7 @@ function SessionInfoTable({ sessionInfo }) {

function getEmailVerificationConfigs({ disableDefaultUI }) {
return EmailVerification.init({
useShadowDom,
disableDefaultUI,
sendVerifyEmailScreen: {
style: theme,
Expand Down
8 changes: 5 additions & 3 deletions examples/for-tests/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,11 @@ if (emailVerificationMode !== "OFF") {
}

if (testContext.enableMFA) {
MultiFactorAuth.init({
firstFactors: testContext.firstFactors,
});
recipeList.push(
MultiFactorAuth.init({
firstFactors: testContext.firstFactors,
})
);
}

SuperTokens.init({
Expand Down
4 changes: 4 additions & 0 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ export async function clearBrowserCookiesWithoutAffectingConsole(page, console)
// TODO: think about moving this elsewhere and/or renaming this function
if (await isMFASupported()) {
await page.evaluate(() => window.localStorage.setItem("enableMFA", "true"));
await Promise.all([
page.goto(`${TEST_CLIENT_BASE_URL}/auth`),
page.waitForNavigation({ waitUntil: "networkidle0" }),
]);
}
return toReturn;
}
Expand Down
4 changes: 2 additions & 2 deletions test/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 35e54ca

Please sign in to comment.