Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions test/end-to-end/generalerror.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ let consoleLogs;

describe("General error rendering", function () {
let coreUrl;
let enabledRecipes = undefined;
before(async function () {
const _isGeneralErrorSupported = await isGeneralErrorSupported();
if (!_isGeneralErrorSupported) {
Expand All @@ -77,7 +76,7 @@ describe("General error rendering", function () {
beforeEach(async function () {
await backendHook("beforeEach");
coreUrl = await setupCoreApp();
await setupST({ coreUrl, enabledRecipes });
await setupST({ coreUrl });
page = await browser.newPage();

consoleLogs = [];
Expand Down Expand Up @@ -212,18 +211,11 @@ describe("General error rendering", function () {
});

describe("ThirdPartyEmailPassword", function () {
before(async function () {
enabledRecipes = ["thirdpartyemailpassword", "session"];
});

getEmailPasswordTests("thirdpartyemailpassword", "THIRD_PARTY_EMAIL_PASSWORD");
getThirdPartyTests("thirdpartyemailpassword", "THIRD_PARTY_EMAIL_PASSWORD");
});

describe("ThirdPartyPasswordless", function () {
before(async function () {
enabledRecipes = ["thirdpartypasswordless", "session"];
});
getThirdPartyTests("thirdpartypasswordless", "THIRD_PARTY_PASSWORDLESS");
});

Expand Down
14 changes: 13 additions & 1 deletion test/end-to-end/getRedirectionURL.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { TEST_CLIENT_BASE_URL, SIGN_IN_UP_API } from "../constants";

describe("getRedirectionURL Tests", function () {
let browser;
let page;

before(async function () {
await backendHook("before");
Expand All @@ -46,6 +45,8 @@ describe("getRedirectionURL Tests", function () {

describe("Test that isNewRecipeUser is passed correctly", function () {
describe("Email Password Recipe", function () {
let page;

beforeEach(async function () {
page = await browser.newPage();
const coreUrl = await setupCoreApp();
Expand All @@ -72,6 +73,8 @@ describe("getRedirectionURL Tests", function () {
});

describe("Third party recipe", function () {
let page;

before(async function () {
const coreUrl = await setupCoreApp();
await setupST({ coreUrl });
Expand Down Expand Up @@ -105,6 +108,8 @@ describe("getRedirectionURL Tests", function () {
});

describe("Thirdpartyemailpassword recipe", function () {
let page;

before(async function () {
const coreUrl = await setupCoreApp();
await setupST({ coreUrl });
Expand Down Expand Up @@ -145,6 +150,7 @@ describe("getRedirectionURL Tests", function () {

describe("Passwordless recipe", function () {
const exampleEmail = "[email protected]";
let page;

before(async function () {
let _isPasswordlessSupported = await isPasswordlessSupported();
Expand Down Expand Up @@ -207,6 +213,7 @@ describe("getRedirectionURL Tests", function () {

describe("ThirdPartyPasswordless recipe", function () {
const exampleEmail = "[email protected]";
let page;

before(async function () {
let _isThirdPartyPasswordlessSupported = await isThirdPartyPasswordlessSupported();
Expand Down Expand Up @@ -283,6 +290,8 @@ describe("getRedirectionURL Tests", function () {

describe("No Redirection", function () {
describe("Email Password Recipe", function () {
let page;

before(async function () {
const coreUrl = await setupCoreApp();
await setupST({ coreUrl });
Expand Down Expand Up @@ -320,6 +329,7 @@ describe("getRedirectionURL Tests", function () {

describe("Passwordless recipe", function () {
const exampleEmail = "[email protected]";
let page;

before(async function () {
let _isPasswordlessSupported = await isPasswordlessSupported();
Expand Down Expand Up @@ -387,6 +397,7 @@ describe("getRedirectionURL Tests", function () {

describe("ThirdPartyPasswordless recipe: Magic Link", function () {
const exampleEmail = "[email protected]";
let page;

before(async function () {
let _isThirdPartyPasswordlessSupported = await isThirdPartyPasswordlessSupported();
Expand Down Expand Up @@ -453,6 +464,7 @@ describe("getRedirectionURL Tests", function () {
});

describe("ThirdParty Recipe", function () {
let page;
before(async function () {
const coreUrl = await setupCoreApp();
await setupST({ coreUrl });
Expand Down
5 changes: 5 additions & 0 deletions test/end-to-end/thirdpartyemailpassword.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
backendHook,
setupCoreApp,
setupST,
isThirdPartyEmailPasswordSupported,
} from "../helpers";
import {
TEST_CLIENT_BASE_URL,
Expand All @@ -71,6 +72,10 @@ describe("SuperTokens Third Party Email Password", function () {
const appConfig = {};

before(async function () {
if (!(await isThirdPartyEmailPasswordSupported())) {
this.skip();
}

await backendHook("before");
const coreUrl = await setupCoreApp();
appConfig.coreUrl = coreUrl;
Expand Down
9 changes: 9 additions & 0 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,15 @@ export async function isThirdPartyPasswordlessSupported() {
return false;
}

export async function isThirdPartyEmailPasswordSupported() {
const features = await getFeatureFlags();
if (features.includes("thirdpartyemailpassword")) {
return true;
}

return false;
}

export async function isUserRolesSupported() {
const features = await getFeatureFlags();
if (!features.includes("userroles")) {
Expand Down
Loading