Skip to content

Commit

Permalink
fix: missing branding from OTP screen (#824)
Browse files Browse the repository at this point in the history
* test: stability fixes + split up test files for better parallelization

* fix: re-add branding into OTP entry screen

* docs: fix typo/missing param in storybook
  • Loading branch information
porcellus authored May 27, 2024
1 parent 2e8650f commit 335dfe3
Show file tree
Hide file tree
Showing 15 changed files with 425 additions and 238 deletions.
42 changes: 24 additions & 18 deletions lib/build/passwordlessprebuiltui.js

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

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { useCallback, useEffect, useState } from "react";
import STGeneralError from "supertokens-web-js/utils/error";

import { withOverride } from "../../../../../components/componentOverride/withOverride";
import { SuperTokensBranding } from "../../../../../components/SuperTokensBranding";
import { hasFontDefined } from "../../../../../styles/styles";
import SuperTokens from "../../../../../superTokens";
import { useTranslation } from "../../../../../translation/translationContext";
Expand Down Expand Up @@ -47,6 +48,7 @@ export const UserInputCodeFormScreen: React.FC<
{props.error !== undefined && <GeneralError error={props.error} />}
<UserInputCodeForm {...props} />
</div>
<SuperTokensBranding />
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions stories/emailverification.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
for (const ui of prebuiltUIs) {
ui.reset();
}
resetAndInitST(recipeList, args.usesDynamicLoginMethods, undefined, {
resetAndInitST(recipeList, args.usesDynamicLoginMethods, undefined, undefined, {
path: args.path,
query: args.query,
hash: args.hash,
Expand All @@ -77,7 +77,7 @@ export default {
};

export const SentEmail: Story = {};
export const LinkCliked: Story = {
export const LinkClicked: Story = {
args: {
path: "/auth/verify-email",
query: "token=asdf",
Expand Down
3 changes: 3 additions & 0 deletions test/end-to-end/mfa.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export async function setupUserWithAllFactors(page) {
const latestURLWithToken = await getLatestURLWithToken();
await Promise.all([page.waitForNavigation({ waitUntil: "networkidle0" }), page.goto(latestURLWithToken)]);

// wait until all the handlers are set up
await waitFor(250);

// click on the continue button
await Promise.all([submitForm(page), page.waitForNavigation({ waitUntil: "networkidle0" })]);

Expand Down
24 changes: 24 additions & 0 deletions test/end-to-end/passwordless.allrecipes.email.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
import { getPasswordlessTestCases } from "./passwordless.test_gen";

describe("SuperTokens Passwordless w/ all recipes enabled", function () {
getPasswordlessTestCases({
authRecipe: "all",
logId: "PASSWORDLESS",
generalErrorRecipeName: "PASSWORDLESS",
contactMethod: "EMAIL",
});
});
24 changes: 24 additions & 0 deletions test/end-to-end/passwordless.allrecipes.email_or_phone.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
import { getPasswordlessTestCases } from "./passwordless.test_gen";

describe("SuperTokens Passwordless w/ all recipes enabled", function () {
getPasswordlessTestCases({
authRecipe: "all",
logId: "PASSWORDLESS",
generalErrorRecipeName: "PASSWORDLESS",
contactMethod: "EMAIL_OR_PHONE",
});
});
24 changes: 24 additions & 0 deletions test/end-to-end/passwordless.allrecipes.phone.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
*
* This software is licensed under the Apache License, Version 2.0 (the
* "License") as published by the Apache Software Foundation.
*
* You may not use this file except in compliance with the License. You may
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
import { getPasswordlessTestCases } from "./passwordless.test_gen";

describe("SuperTokens Passwordless w/ all recipes enabled", function () {
getPasswordlessTestCases({
authRecipe: "all",
logId: "PASSWORDLESS",
generalErrorRecipeName: "PASSWORDLESS",
contactMethod: "PHONE",
});
});
13 changes: 13 additions & 0 deletions test/end-to-end/passwordless.email.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getPasswordlessTestCases } from "./passwordless.test_gen";

/*
* Tests.
*/
describe("SuperTokens Passwordless", function () {
getPasswordlessTestCases({
authRecipe: "passwordless",
logId: "PASSWORDLESS",
generalErrorRecipeName: "PASSWORDLESS",
contactMethod: "EMAIL",
});
});
13 changes: 13 additions & 0 deletions test/end-to-end/passwordless.email_or_phone.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getPasswordlessTestCases } from "./passwordless.test_gen";

/*
* Tests.
*/
describe("SuperTokens Passwordless", function () {
getPasswordlessTestCases({
authRecipe: "passwordless",
logId: "PASSWORDLESS",
generalErrorRecipeName: "PASSWORDLESS",
contactMethod: "EMAIL_OR_PHONE",
});
});
13 changes: 13 additions & 0 deletions test/end-to-end/passwordless.phone.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getPasswordlessTestCases } from "./passwordless.test_gen";

/*
* Tests.
*/
describe("SuperTokens Passwordless", function () {
getPasswordlessTestCases({
authRecipe: "passwordless",
logId: "PASSWORDLESS",
generalErrorRecipeName: "PASSWORDLESS",
contactMethod: "PHONE",
});
});
Loading

0 comments on commit 335dfe3

Please sign in to comment.