Skip to content

Commit

Permalink
Handle react 16 tests for new features (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitbadala authored Nov 20, 2023
1 parent ab1f839 commit 79b91a8
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
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

0 comments on commit 79b91a8

Please sign in to comment.