Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle react 16 tests for new features #764

Merged
merged 1 commit into from
Nov 20, 2023
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
15 changes: 15 additions & 0 deletions test/end-to-end/signin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
waitForText,
backendBeforeEach,
getInputField,
isReact16,
} from "../helpers";
import fetch from "isomorphic-fetch";
import { SOMETHING_WENT_WRONG_ERROR } from "../constants";
Expand Down Expand Up @@ -672,6 +673,13 @@ describe("SuperTokens SignIn", function () {
});

describe("Default fields", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

it("Should contain email and password fields prefilled", async function () {
await page.evaluate(() => window.localStorage.setItem("SIGNIN_SETTING_TYPE", "DEFAULT_FIELDS"));

Expand Down Expand Up @@ -751,6 +759,13 @@ describe("SuperTokens SignIn", function () {
});

describe("nonOptionalErrorMsg", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

it("Should be displayed on a blank form submit", async function () {
// set cookie and reload which loads the form with custom field
await page.evaluate(() =>
Expand Down
21 changes: 21 additions & 0 deletions test/end-to-end/signup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
backendBeforeEach,
setSelectDropdownValue,
getInputField,
isReact16,
} from "../helpers";

import {
Expand Down Expand Up @@ -346,6 +347,12 @@ describe("SuperTokens SignUp", function () {
});

describe("Custom fields tests", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});
beforeEach(async function () {
// set cookie and reload which loads the form with custom field
await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS"));
Expand Down Expand Up @@ -568,6 +575,13 @@ describe("SuperTokens SignUp", function () {

// Default values test
describe("Default fields tests", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

beforeEach(async function () {
// set cookie and reload which loads the form fields with default values
await page.evaluate(() =>
Expand Down Expand Up @@ -684,6 +698,13 @@ describe("SuperTokens SignUp", function () {
});

describe("Incorrect field config test", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

beforeEach(async function () {
// set cookie and reload which loads the form fields with default values
await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_FIELDS"));
Expand Down
29 changes: 29 additions & 0 deletions test/end-to-end/thirdpartyemailpassword.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
setSelectDropdownValue,
getInputField,
getLabelsText,
isReact16,
} from "../helpers";
import {
TEST_CLIENT_BASE_URL,
Expand Down Expand Up @@ -445,6 +446,13 @@ describe("SuperTokens Third Party Email Password", function () {
});

describe("SignIn default field tests", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

it("Should contain email and password fields prefilled", async function () {
await page.evaluate(() => window.localStorage.setItem("SIGNIN_SETTING_TYPE", "DEFAULT_FIELDS"));

Expand Down Expand Up @@ -510,6 +518,13 @@ describe("SuperTokens Third Party Email Password", function () {
});

describe("Third Party signup config supports custom fields tests", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

beforeEach(async function () {
await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "CUSTOM_FIELDS"));

Expand Down Expand Up @@ -743,6 +758,13 @@ describe("SuperTokens Third Party Email Password", function () {

// Default values test
describe("Third Party signup default value for fields test", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

beforeEach(async function () {
// set cookie and reload which loads the form fields with default values
await page.evaluate(() =>
Expand Down Expand Up @@ -867,6 +889,13 @@ describe("SuperTokens Third Party Email Password", function () {
});

describe("Third Party signup config Incorrect field message test", function () {
before(function () {
const isReact16App = isReact16();
if (isReact16App) {
this.skip();
}
});

beforeEach(async function () {
// set cookie and reload which loads the form fields with default values
await page.evaluate(() => window.localStorage.setItem("SIGNUP_SETTING_TYPE", "INCORRECT_FIELDS"));
Expand Down
Loading