Skip to content

Commit b781f1e

Browse files
authored
test: update tests to pass with new node version as well (#801)
* test: update tests to pass with new node version as well * chore: update version number
1 parent 4b2a650 commit b781f1e

File tree

6 files changed

+15
-43
lines changed

6 files changed

+15
-43
lines changed

lib/build/genericComponentOverrideContext.js

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/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.38.0";
15+
export const package_version = "0.38.1";

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.38.0",
3+
"version": "0.38.1",
44
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
55
"main": "./index.js",
66
"engines": {

test/end-to-end/accountlinking.test.js

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,14 @@ describe("SuperTokens Account linking", function () {
280280
const email = `test-user+${Date.now()}@supertokens.com`;
281281

282282
await setAccountLinkingConfig(true, false);
283-
// 1. Sign up without account linking with an unverified tp user & log out
283+
// 1. Sign up without account linking with an unverified ep and tp users & log out
284+
// We need both, because when setting up the pwless user we'll link to the older one
285+
await tryThirdPartySignInUp(page, email, false);
286+
await Promise.all([page.waitForSelector(".sessionInfo-user-id"), page.waitForNetworkIdle()]);
287+
await logOut(page);
288+
284289
await tryEmailPasswordSignUp(page, email);
290+
await Promise.all([page.waitForSelector(".sessionInfo-user-id"), page.waitForNetworkIdle()]);
285291
await logOut(page);
286292

287293
await setAccountLinkingConfig(true, true, false);
@@ -377,6 +383,8 @@ describe("SuperTokens Account linking", function () {
377383
const email = `test-user+${Date.now()}@supertokens.com`;
378384

379385
await setAccountLinkingConfig(true, false);
386+
await tryEmailPasswordSignUp(page, email);
387+
await logOut(page);
380388
// 1. Sign up without account linking with an unverified tp user & log out
381389
await tryThirdPartySignInUp(page, email, false);
382390
await logOut(page);
@@ -429,42 +437,6 @@ describe("SuperTokens Account linking", function () {
429437
assert.strictEqual(new URL(page.url()).pathname, "/auth/");
430438
});
431439

432-
it("should not allow sign up w/ passwordless after changing the email if it conflicts with an unverified user", async function () {
433-
const email = `test-user+${Date.now()}@supertokens.com`;
434-
const email2 = `test-user-2+${Date.now()}@supertokens.com`;
435-
436-
await setAccountLinkingConfig(true, false);
437-
// 1. Sign up without account linking with an unverified tp user & log out
438-
await tryEmailPasswordSignUp(page, email);
439-
await logOut(page);
440-
441-
// 2. Sign up with passwordless
442-
await tryPasswordlessSignInUp(page, email2);
443-
await Promise.all([page.waitForSelector(".sessionInfo-user-id"), page.waitForNetworkIdle()]);
444-
const accessTokenPayload = await page.evaluate(() =>
445-
window.__supertokensSessionRecipe.getAccessTokenPayloadSecurely()
446-
);
447-
const userId = accessTokenPayload.sub;
448-
await logOut(page);
449-
450-
await page.evaluate(() => localStorage.removeItem("supertokens-passwordless-loginAttemptInfo"));
451-
await Promise.all([
452-
page.goto(`${TEST_CLIENT_BASE_URL}/auth/?authRecipe=passwordless`),
453-
page.waitForNavigation({ waitUntil: "networkidle0" }),
454-
]);
455-
await changeEmail("passwordless", userId, email);
456-
await setAccountLinkingConfig(true, true, true);
457-
458-
await setInputValues(page, [{ name: "emailOrPhone", value: email }]);
459-
await submitForm(page);
460-
461-
assert.strictEqual(
462-
await getGeneralError(page),
463-
"Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_003)"
464-
);
465-
assert.strictEqual(new URL(page.url()).pathname, "/auth/");
466-
});
467-
468440
it("should not allow sign up w/ passwordless if it conflicts with an unverified user", async function () {
469441
const email = `test-user+${Date.now()}@supertokens.com`;
470442

0 commit comments

Comments
 (0)