Skip to content

Commit 19fa8ab

Browse files
authored
test: split tppwless tests into multiple files to help with parallelization (#742)
* test: split tppwless tests into multiple files to help with parallelization * chore: bump patch version
1 parent 2ff1031 commit 19fa8ab

File tree

9 files changed

+147
-23
lines changed

9 files changed

+147
-23
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
## [0.35.2] - 2023-09-24
11+
12+
### Test changes
13+
14+
- Split some test suites into multiple files to help with test parallelization
15+
1016
## [0.35.1] - 2023-09-21
1117

1218
### Test changes

lib/build/version.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ts/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
* License for the specific language governing permissions and limitations
1313
* under the License.
1414
*/
15-
export const package_version = "0.35.1";
15+
export const package_version = "0.35.2";

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supertokens-auth-react",
3-
"version": "0.35.1",
3+
"version": "0.35.2",
44
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
55
"main": "./index.js",
66
"engines": {
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
2+
*
3+
* This software is licensed under the Apache License, Version 2.0 (the
4+
* "License") as published by the Apache Software Foundation.
5+
*
6+
* You may not use this file except in compliance with the License. You may
7+
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
* License for the specific language governing permissions and limitations
13+
* under the License.
14+
*/
15+
16+
/*
17+
* Imports
18+
*/
19+
20+
import assert from "assert";
21+
import puppeteer from "puppeteer";
22+
import {
23+
clearBrowserCookiesWithoutAffectingConsole,
24+
clickOnProviderButton,
25+
getUserIdWithFetch,
26+
getLogoutButton,
27+
loginWithAuth0,
28+
setInputValues,
29+
submitForm,
30+
waitForSTElement,
31+
getPasswordlessDevice,
32+
setPasswordlessFlowType,
33+
getFeatureFlags,
34+
isReact16,
35+
assertProviders,
36+
setEnabledRecipes,
37+
clickOnProviderButtonWithoutWaiting,
38+
getGeneralError,
39+
backendBeforeEach,
40+
} from "../helpers";
41+
import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants";
42+
import { getThirdPartyTestCases } from "./thirdparty.test";
43+
import { getPasswordlessTestCases } from "./passwordless.test";
44+
45+
/*
46+
* Tests.
47+
*/
48+
describe("SuperTokens Third Party Passwordless", function () {
49+
before(async function () {
50+
const features = await getFeatureFlags();
51+
if (!features.includes("thirdpartypasswordless")) {
52+
this.skip();
53+
}
54+
});
55+
56+
describe("Passwordless specific", function () {
57+
getPasswordlessTestCases({
58+
authRecipe: "thirdpartypasswordless",
59+
logId: "THIRDPARTYPASSWORDLESS",
60+
generalErrorRecipeName: "THIRD_PARTY_PASSWORDLESS",
61+
});
62+
});
63+
});

test/end-to-end/thirdpartypasswordless.test.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,4 @@ describe("SuperTokens Third Party Passwordless", function () {
225225
assert.strictEqual(await getGeneralError(page), "Something went wrong. Please try again.");
226226
});
227227
});
228-
229-
describe("Third Party specific", function () {
230-
getThirdPartyTestCases({
231-
authRecipe: "thirdpartypasswordless",
232-
rid: "thirdpartypasswordless",
233-
logId: "THIRDPARTYPASSWORDLESS",
234-
signInUpPageLoadLogs,
235-
thirdPartySignInUpLog: "THIRD_PARTY_SIGN_IN_AND_UP",
236-
});
237-
});
238-
239-
describe("Passwordless specific", function () {
240-
getPasswordlessTestCases({
241-
authRecipe: "thirdpartypasswordless",
242-
logId: "THIRDPARTYPASSWORDLESS",
243-
generalErrorRecipeName: "THIRD_PARTY_PASSWORDLESS",
244-
});
245-
});
246228
});
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
2+
*
3+
* This software is licensed under the Apache License, Version 2.0 (the
4+
* "License") as published by the Apache Software Foundation.
5+
*
6+
* You may not use this file except in compliance with the License. You may
7+
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
* License for the specific language governing permissions and limitations
13+
* under the License.
14+
*/
15+
16+
/*
17+
* Imports
18+
*/
19+
20+
import assert from "assert";
21+
import puppeteer from "puppeteer";
22+
import {
23+
clearBrowserCookiesWithoutAffectingConsole,
24+
clickOnProviderButton,
25+
getUserIdWithFetch,
26+
getLogoutButton,
27+
loginWithAuth0,
28+
setInputValues,
29+
submitForm,
30+
waitForSTElement,
31+
getPasswordlessDevice,
32+
setPasswordlessFlowType,
33+
getFeatureFlags,
34+
isReact16,
35+
assertProviders,
36+
setEnabledRecipes,
37+
clickOnProviderButtonWithoutWaiting,
38+
getGeneralError,
39+
backendBeforeEach,
40+
} from "../helpers";
41+
import { TEST_CLIENT_BASE_URL, TEST_SERVER_BASE_URL, SIGN_IN_UP_API, GET_AUTH_URL_API } from "../constants";
42+
import { getThirdPartyTestCases } from "./thirdparty.test";
43+
import { getPasswordlessTestCases } from "./passwordless.test";
44+
45+
/*
46+
* Tests.
47+
*/
48+
describe("SuperTokens Third Party Passwordless", function () {
49+
const signInUpPageLoadLogs = isReact16()
50+
? ["ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO"]
51+
: [
52+
"ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO",
53+
"ST_LOGS THIRDPARTYPASSWORDLESS OVERRIDE GET_LOGIN_ATTEMPT_INFO",
54+
];
55+
56+
before(async function () {
57+
const features = await getFeatureFlags();
58+
if (!features.includes("thirdpartypasswordless")) {
59+
this.skip();
60+
}
61+
});
62+
63+
describe("Third Party specific", function () {
64+
getThirdPartyTestCases({
65+
authRecipe: "thirdpartypasswordless",
66+
rid: "thirdpartypasswordless",
67+
logId: "THIRDPARTYPASSWORDLESS",
68+
signInUpPageLoadLogs,
69+
thirdPartySignInUpLog: "THIRD_PARTY_SIGN_IN_AND_UP",
70+
});
71+
});
72+
});

test/server/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ app.post("/beforeeach", async (req, res) => {
268268

269269
await killAllST();
270270
await setupST();
271+
initST();
271272
res.send();
272273
});
273274

0 commit comments

Comments
 (0)