Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Commit 07f5905

Browse files
committed
test: use registerUserViaApi function
1 parent 1b3702a commit 07f5905

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

client/e2e/global-setup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import ms from "ms";
33
import child_process from "node:child_process";
44
import { promisify } from "node:util";
55
import { globalCredentials } from "./global-credentials";
6-
import { registerUser } from "./register-user.function";
6+
import { registerUserViaApi } from "./register-user.function";
77

88
const exec = promisify(child_process.exec);
99

10-
test("Global setup", async ({ page }) => {
10+
test("Global setup", async ({ page, request }) => {
1111
test.setTimeout(ms("20 seconds"));
1212
await exec("docker compose up --detach");
1313

1414
console.log("Waiting for servers to be ready...");
1515
await exec("npm run wait:servers");
1616
console.log("Servers are ready ✔");
1717

18-
await registerUser(page, globalCredentials);
18+
await registerUserViaApi(request, globalCredentials);
1919
console.log("Global setup complete ✔");
2020
});

client/e2e/tests/session-revocation.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ import { Credentials } from "_server/types/credentials";
44
import { UserMessage } from "../../src/app/types/user-message.enum";
55
import { test } from "../fixtures";
66
import { logInUser } from "../log-in-user.function";
7-
import { registerUser } from "../register-user.function";
7+
import { registerUserViaApi } from "../register-user.function";
88

99
test.describe("Session revocation", () => {
1010
let credentials: Credentials;
1111

12-
test.beforeEach(async ({ browser, page }) => {
13-
const context = await browser.newContext();
12+
test.beforeEach(async ({ page, request }) => {
1413
credentials = getFakeCredentials();
1514

16-
await registerUser(await context.newPage(), credentials);
15+
await registerUserViaApi(request, credentials);
1716
await logInUser(page, credentials);
1817
});
1918

0 commit comments

Comments
 (0)