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

test: fix test in backend SDK ci #740

Merged
merged 8 commits into from
Sep 22, 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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.35.0] - 2023-09-XX
## [0.35.1] - 2023-09-21

### Test changes

- Test fixes for backend SDK CI

## [0.35.0] - 2023-09-21

### Overview

Expand Down
2 changes: 1 addition & 1 deletion lib/build/version.d.ts

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

2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const package_version = "0.35.0";
export const package_version = "0.35.1";
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-auth-react",
"version": "0.35.0",
"version": "0.35.1",
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
"main": "./index.js",
"engines": {
Expand Down
5 changes: 2 additions & 3 deletions test/end-to-end/accountlinking.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
getTextByDataSupertokens,
sendEmailResetPasswordSuccessMessage,
changeEmail,
backendBeforeEach,
} from "../helpers";
import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, RESET_PASSWORD_API } from "../constants";

Expand All @@ -64,9 +65,7 @@ describe("SuperTokens Account linking", function () {

describe("Recipe combination tests", () => {
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
17 changes: 5 additions & 12 deletions test/end-to-end/emailverification.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
isGeneralErrorSupported,
setGeneralErrorToLocalStorage,
isAccountLinkingSupported,
backendBeforeEach,
} from "../helpers";

describe("SuperTokens Email Verification", function () {
Expand All @@ -60,9 +61,7 @@ describe("SuperTokens Email Verification", function () {
let accountLinkingSupported;

before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();
await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
}).catch(console.error);
Expand Down Expand Up @@ -675,9 +674,7 @@ describe("SuperTokens Email Verification general errors", function () {
const generalErrorMessageString = "General Error";

before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();
await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
}).catch(console.error);
Expand Down Expand Up @@ -797,9 +794,7 @@ describe("SuperTokens Email Verification isEmailVerified server error", function

before(async function () {
// Start server.
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -880,9 +875,7 @@ describe("Email verification signOut errors", function () {
let browser;
let page;
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
6 changes: 2 additions & 4 deletions test/end-to-end/embed.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TEST_SERVER_BASE_URL } from "../constants";
import { AuthPage } from "./pages/AuthPage";
import { EmailVerificationPage } from "./pages/EmailVerificationPage";
import { ResetPasswordPage } from "./pages/ResetPasswordPage";
import { clearBrowserCookiesWithoutAffectingConsole, screenshotOnFailure } from "../helpers";
import { backendBeforeEach, clearBrowserCookiesWithoutAffectingConsole, screenshotOnFailure } from "../helpers";

describe("Embed components", async () => {
let browser;
Expand All @@ -17,9 +17,7 @@ describe("Embed components", async () => {
headless: true,
});

await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();
await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
}).catch(console.error);
Expand Down
13 changes: 4 additions & 9 deletions test/end-to-end/generalerror.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
loginWithAuth0,
isGeneralErrorSupported,
setGeneralErrorToLocalStorage,
backendBeforeEach,
} from "../helpers";

import {
Expand Down Expand Up @@ -70,9 +71,7 @@ describe("General error rendering", function () {
let browser;
let page;
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -236,9 +235,7 @@ function getEmailPasswordTests(rid, ridForStorage) {
let browser;
let page;
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -376,9 +373,7 @@ function getThirdPartyTests(rid, ridForStorage) {
let browser;
let page;
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
24 changes: 6 additions & 18 deletions test/end-to-end/getRedirectionURL.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
clearBrowserCookiesWithoutAffectingConsole,
isPasswordlessSupported,
isThirdPartyPasswordlessSupported,
backendBeforeEach,
} from "../helpers";

import {
Expand All @@ -31,9 +32,7 @@ describe("getRedirectionURL Tests", function () {
let browser;
let page;
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -81,9 +80,7 @@ describe("getRedirectionURL Tests", function () {
let browser;
let page;
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -136,9 +133,7 @@ describe("getRedirectionURL Tests", function () {
let browser;
let page;
before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -208,12 +203,7 @@ describe("getRedirectionURL Tests", function () {
return;
}

await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -300,9 +290,7 @@ describe("getRedirectionURL Tests", function () {
return;
}

await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
5 changes: 2 additions & 3 deletions test/end-to-end/multitenancy.dynamic_login_methods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
isMultitenancySupported,
isMultitenancyManagementEndpointsSupported,
setupTenant,
backendBeforeEach,
} from "../helpers";
import {
TEST_CLIENT_BASE_URL,
Expand Down Expand Up @@ -65,9 +66,7 @@ describe("SuperTokens Multitenancy dynamic login methods", function () {
});

beforeEach(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

const startSTResp = await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
7 changes: 3 additions & 4 deletions test/end-to-end/multitenancy.tenant_interactions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
addUserToTenant,
removeUserFromTenant,
removeTenant,
backendBeforeEach,
} from "../helpers";
import {
TEST_CLIENT_BASE_URL,
Expand All @@ -71,9 +72,7 @@ describe("SuperTokens Multitenancy tenant interactions", function () {
});

beforeEach(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down Expand Up @@ -1094,7 +1093,7 @@ describe("SuperTokens Multitenancy tenant interactions", function () {
{ name: "confirm-password", value: newPassword },
]);
await submitForm(page);
assert.strictEqual(await getGeneralError(page), "Invalid password reset token");
assert.strictEqual(await getGeneralError(page), "Something went wrong. Please try again.");
});
});

Expand Down
8 changes: 2 additions & 6 deletions test/end-to-end/passwordless.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
setGeneralErrorToLocalStorage,
getInputField,
isAccountLinkingSupported,
backendBeforeEach,
} from "../helpers";

import {
Expand Down Expand Up @@ -2121,12 +2122,7 @@ async function setupDevice(page, inputName, contactInfo, forLinkOnly = true, cle
}

async function initBrowser(contactMethod, consoleLogs, authRecipe, { defaultCountry, disablePhoneGuess } = {}) {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await fetch(`${TEST_APPLICATION_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
5 changes: 2 additions & 3 deletions test/end-to-end/resetpasswordusingtoken.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
getResetPasswordFormBackButton,
waitForSTElement,
getResetPasswordSuccessBackToSignInButton,
backendBeforeEach,
} from "../helpers";

/*
Expand All @@ -63,9 +64,7 @@ describe("SuperTokens Reset password", function () {
let consoleLogs;

before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
5 changes: 2 additions & 3 deletions test/end-to-end/signin-rrdv5.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
screenshotOnFailure,
waitForText,
waitForSTElement,
backendBeforeEach,
} from "../helpers";
import fetch from "isomorphic-fetch";
import { SOMETHING_WENT_WRONG_ERROR } from "../constants";
Expand All @@ -68,9 +69,7 @@ describe("SuperTokens SignIn with react router dom v5", function () {
this.skip();
}

await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
5 changes: 2 additions & 3 deletions test/end-to-end/signin-rrdv6.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
screenshotOnFailure,
waitForText,
waitForSTElement,
backendBeforeEach,
} from "../helpers";
import fetch from "isomorphic-fetch";
import { SOMETHING_WENT_WRONG_ERROR } from "../constants";
Expand All @@ -64,9 +65,7 @@ describe("SuperTokens SignIn with react router dom v6", function () {
let consoleLogs = [];

before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
5 changes: 2 additions & 3 deletions test/end-to-end/signin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
setGeneralErrorToLocalStorage,
getInvalidClaimsJSON as getInvalidClaims,
waitForText,
backendBeforeEach,
} from "../helpers";
import fetch from "isomorphic-fetch";
import { SOMETHING_WENT_WRONG_ERROR } from "../constants";
Expand All @@ -67,9 +68,7 @@ describe("SuperTokens SignIn", function () {
let consoleLogs = [];

before(async function () {
await fetch(`${TEST_SERVER_BASE_URL}/beforeeach`, {
method: "POST",
}).catch(console.error);
await backendBeforeEach();

await fetch(`${TEST_SERVER_BASE_URL}/startst`, {
method: "POST",
Expand Down
Loading
Loading