Skip to content

Commit 19d5fad

Browse files
Get rid of using random UUID for appId
1 parent e6cf3af commit 19d5fad

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import {
4545
screenshotOnFailure,
4646
} from "../helpers";
4747
import { TEST_CLIENT_BASE_URL, RESET_PASSWORD_API } from "../constants";
48-
import { randomUUID } from "node:crypto";
4948

5049
/*
5150
* Tests.
@@ -322,8 +321,7 @@ describe("SuperTokens Account linking", function () {
322321

323322
it("should not allow sign in w/ an unverified emailpassword user in case of conflict", async function () {
324323
// Use a common appId over the test to allow re-inits
325-
const appId = randomUUID();
326-
const coreUrl = await setupCoreApp({ appId });
324+
const coreUrl = await setupCoreApp({ appId: "test-app-id" });
327325
await setupST({
328326
coreUrl,
329327
passwordlessFlowType,
@@ -491,8 +489,7 @@ describe("SuperTokens Account linking", function () {
491489

492490
it("should not allow sign in w/ an unverified thirdparty user in case of conflict", async function () {
493491
// Use a common appId over the test to allow re-inits
494-
const appId = randomUUID();
495-
const coreUrl = await setupCoreApp({ appId });
492+
const coreUrl = await setupCoreApp({ appId: "test-app-id" });
496493
await setupST({
497494
coreUrl,
498495
passwordlessFlowType,
@@ -561,8 +558,7 @@ describe("SuperTokens Account linking", function () {
561558
const email = `test-user+${Date.now()}@supertokens.com`;
562559

563560
// Use a common appId over the test to allow re-inits
564-
const appId = randomUUID();
565-
const coreUrl = await setupCoreApp({ appId });
561+
const coreUrl = await setupCoreApp({ appId: "test-app-id" });
566562
await setupST({
567563
coreUrl,
568564
passwordlessFlowType,
@@ -611,8 +607,7 @@ describe("SuperTokens Account linking", function () {
611607
it("should not allow sign up w/ passwordless if it conflicts with an unverified user", async function () {
612608
const email = `test-user+${Date.now()}@supertokens.com`;
613609
// Use a common appId over the test to allow re-inits
614-
const appId = randomUUID();
615-
const coreUrl = await setupCoreApp({ appId });
610+
const coreUrl = await setupCoreApp({ appId: "test-app-id" });
616611
await setupST({
617612
coreUrl,
618613
passwordlessFlowType,
@@ -663,8 +658,7 @@ describe("SuperTokens Account linking", function () {
663658
const email2 = `test-user2+${Date.now()}@supertokens.com`;
664659

665660
// Use a common appId over the test to allow re-inits
666-
const appId = randomUUID();
667-
const coreUrl = await setupCoreApp({ appId });
661+
const coreUrl = await setupCoreApp({ appId: "test-app-id" });
668662
await setupST({
669663
coreUrl,
670664
passwordlessFlowType,
@@ -739,8 +733,7 @@ describe("SuperTokens Account linking", function () {
739733
await page.evaluate(() => window.localStorage.setItem("mode", "REQUIRED"));
740734

741735
// Use a common appId over the test to allow re-inits
742-
const appId = randomUUID();
743-
const coreUrl = await setupCoreApp({ appId });
736+
const coreUrl = await setupCoreApp({ appId: "test-app-id" });
744737
await setupST({
745738
coreUrl,
746739
passwordlessFlowType,

test/end-to-end/passwordless.test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141

4242
import { TEST_CLIENT_BASE_URL, SOMETHING_WENT_WRONG_ERROR } from "../constants";
4343
import { tryEmailPasswordSignUp, tryPasswordlessSignInUp } from "./mfa.helpers";
44-
import { randomUUID } from "crypto";
4544

4645
/*
4746
* Tests.
@@ -350,9 +349,8 @@ export function getPasswordlessTestCases({ authRecipe, logId, generalErrorRecipe
350349
const contactMethod = "EMAIL_OR_PHONE";
351350

352351
before(async function () {
353-
const appId = randomUUID();
354352
const coreUrl = await setupCoreApp({
355-
appId,
353+
appId: "test-app-id",
356354
coreConfig: {
357355
passwordless_code_lifetime: 4000,
358356
passwordless_max_code_input_attempts: 3,
@@ -543,15 +541,14 @@ export function getPasswordlessTestCases({ authRecipe, logId, generalErrorRecipe
543541
function getTestCases(contactMethod, inputName, contactInfo) {
544542
let accountLinkingSupported;
545543
let coreUrl;
546-
const appId = randomUUID();
547544
const coreConfig = {
548545
passwordless_code_lifetime: 4000,
549546
passwordless_max_code_input_attempts: 3,
550547
};
551548

552549
before(async function () {
553550
coreUrl = await setupCoreApp({
554-
appId,
551+
appId: "test-app-id",
555552
coreConfig,
556553
});
557554
});

0 commit comments

Comments
 (0)