mirror of
https://github.com/coder/coder.git
synced 2026-06-03 13:08:25 +00:00
962608cde0
Closes coder/internal#168 Gets rid of the "global state" authentication, and adds a `login` helper which should be called at the beginning of each test. This means that not every test needs to authenticated as admin, and we can even have tests that encompass multiple permission levels. We also now create more than just the single admin user during setup, so that we can have a set of users to pick from as appropriate.
18 lines
448 B
TypeScript
18 lines
448 B
TypeScript
import { test } from "@playwright/test";
|
|
import { createUser } from "../../helpers";
|
|
import { login } from "../../helpers";
|
|
import { beforeCoderTest } from "../../hooks";
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
beforeCoderTest(page);
|
|
await login(page);
|
|
});
|
|
|
|
test("create user with password", async ({ page }) => {
|
|
await createUser(page);
|
|
});
|
|
|
|
test("create user without full name", async ({ page }) => {
|
|
await createUser(page, { name: "" });
|
|
});
|