diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d9fc7119..be75c2fe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +## [0.35.2] - 2023-09-24 + +### Test changes + +- Split some test suites into multiple files to help with test parallelization + ## [0.35.1] - 2023-09-21 ### Test changes diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index 7fb9cebdf..2930185f2 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1 +1 @@ -export declare const package_version = "0.35.1"; +export declare const package_version = "0.35.2"; diff --git a/lib/ts/version.ts b/lib/ts/version.ts index 7c9a1c8e6..d6c04883e 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,4 +12,4 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const package_version = "0.35.1"; +export const package_version = "0.35.2"; diff --git a/package-lock.json b/package-lock.json index 1c804b07b..ce8b7dfff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-auth-react", - "version": "0.35.1", + "version": "0.35.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-auth-react", - "version": "0.35.1", + "version": "0.35.2", "license": "Apache-2.0", "dependencies": { "intl-tel-input": "^17.0.19", diff --git a/package.json b/package.json index 8243dd50c..82ef8f647 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-auth-react", - "version": "0.35.1", + "version": "0.35.2", "description": "ReactJS SDK that provides login functionality with SuperTokens.", "main": "./index.js", "engines": { diff --git a/test/end-to-end/thirdpartypasswordless.pwless.test.js b/test/end-to-end/thirdpartypasswordless.pwless.test.js new file mode 100644 index 000000000..6e881a36d --- /dev/null +++ b/test/end-to-end/thirdpartypasswordless.pwless.test.js @@ -0,0 +1,63 @@ +/* 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. + */ + +/* + * Imports + */ + +import assert from "assert"; +import puppeteer from "puppeteer"; +import { + clearBrowserCookiesWithoutAffectingConsole, + clickOnProviderButton, + getUserIdWithFetch, + getLogoutButton, + loginWithAuth0, + setInputValues, + submitForm, + waitForSTElement, + getPasswordlessDevice, + setPasswordlessFlowType, + getFeatureFlags, + isReact16, + assertProviders, + setEnabledRecipes, + clickOnProviderButtonWithoutWaiting, + getGeneralError, + backendBeforeEach, +} from "../helpers"; +import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants"; +import { getThirdPartyTestCases } from "./thirdparty.test"; +import { getPasswordlessTestCases } from "./passwordless.test"; + +/* + * Tests. + */ +describe("SuperTokens Third Party Passwordless", function () { + before(async function () { + const features = await getFeatureFlags(); + if (!features.includes("thirdpartypasswordless")) { + this.skip(); + } + }); + + describe("Passwordless specific", function () { + getPasswordlessTestCases({ + authRecipe: "thirdpartypasswordless", + logId: "THIRDPARTYPASSWORDLESS", + generalErrorRecipeName: "THIRD_PARTY_PASSWORDLESS", + }); + }); +}); diff --git a/test/end-to-end/thirdpartypasswordless.test.js b/test/end-to-end/thirdpartypasswordless.test.js index cb7ac0bd2..ab45c5d8e 100644 --- a/test/end-to-end/thirdpartypasswordless.test.js +++ b/test/end-to-end/thirdpartypasswordless.test.js @@ -225,22 +225,4 @@ describe("SuperTokens Third Party Passwordless", function () { assert.strictEqual(await getGeneralError(page), "Something went wrong. Please try again."); }); }); - - describe("Third Party specific", function () { - getThirdPartyTestCases({ - authRecipe: "thirdpartypasswordless", - rid: "thirdpartypasswordless", - logId: "THIRDPARTYPASSWORDLESS", - signInUpPageLoadLogs, - thirdPartySignInUpLog: "THIRD_PARTY_SIGN_IN_AND_UP", - }); - }); - - describe("Passwordless specific", function () { - getPasswordlessTestCases({ - authRecipe: "thirdpartypasswordless", - logId: "THIRDPARTYPASSWORDLESS", - generalErrorRecipeName: "THIRD_PARTY_PASSWORDLESS", - }); - }); }); diff --git a/test/end-to-end/thirdpartypasswordless.tp.test.js b/test/end-to-end/thirdpartypasswordless.tp.test.js new file mode 100644 index 000000000..71943298f --- /dev/null +++ b/test/end-to-end/thirdpartypasswordless.tp.test.js @@ -0,0 +1,72 @@ +/* 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. + */ + +/* + * Imports + */ + +import assert from "assert"; +import puppeteer from "puppeteer"; +import { + clearBrowserCookiesWithoutAffectingConsole, + clickOnProviderButton, + getUserIdWithFetch, + getLogoutButton, + loginWithAuth0, + setInputValues, + submitForm, + waitForSTElement, + getPasswordlessDevice, + setPasswordlessFlowType, + getFeatureFlags, + isReact16, + assertProviders, + setEnabledRecipes, + clickOnProviderButtonWithoutWaiting, + getGeneralError, + backendBeforeEach, +} from "../helpers"; +import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants"; +import { getThirdPartyTestCases } from "./thirdparty.test"; +import { getPasswordlessTestCases } from "./passwordless.test"; + +/* + * Tests. + */ +describe("SuperTokens Third Party Passwordless", function () { + const signInUpPageLoadLogs = isReact16() + ? ["ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO"] + : [ + "ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO", + "ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO", + ]; + + before(async function () { + const features = await getFeatureFlags(); + if (!features.includes("thirdpartypasswordless")) { + this.skip(); + } + }); + + describe("Third Party specific", function () { + getThirdPartyTestCases({ + authRecipe: "thirdpartypasswordless", + rid: "thirdpartypasswordless", + logId: "THIRDPARTYPASSWORDLESS", + signInUpPageLoadLogs, + thirdPartySignInUpLog: "THIRD_PARTY_SIGN_IN_AND_UP", + }); + }); +}); diff --git a/test/server/index.js b/test/server/index.js index e05e753d1..f001d7fdb 100644 --- a/test/server/index.js +++ b/test/server/index.js @@ -268,6 +268,7 @@ app.post("/beforeeach", async (req, res) => { await killAllST(); await setupST(); + initST(); res.send(); });