Skip to content

Commit e7dd67b

Browse files
committed
split up tests
1 parent de7c1db commit e7dd67b

File tree

1 file changed

+33
-5
lines changed

1 file changed

+33
-5
lines changed

site/e2e/tests/auditLogs.spec.ts

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
} from "../helpers";
1010
import { beforeCoderTest } from "../hooks";
1111

12+
test.describe.configure({ mode: "parallel" });
13+
1214
test.beforeEach(async ({ page }) => {
1315
beforeCoderTest(page);
1416
await login(page, users.auditor);
@@ -27,7 +29,20 @@ async function resetSearch(page: Page) {
2729
await expect(page.getByText("All users")).not.toBeVisible();
2830
}
2931

30-
test("inspecting and filtering audit logs", async ({ page }) => {
32+
test("logins are logged", async ({ page }) => {
33+
requiresLicense();
34+
35+
// Go to the audit history
36+
await page.goto("/audit");
37+
38+
const user = currentUser(page);
39+
const loginMessage = `${user.username} logged in`;
40+
// Make sure those things we did all actually show up
41+
await resetSearch(page);
42+
await expect(page.getByText(loginMessage).first()).toBeVisible();
43+
});
44+
45+
test("creating templates and workspaces is logged", async ({ page }) => {
3146
requiresLicense();
3247

3348
// Do some stuff that should show up in the audit logs
@@ -38,18 +53,18 @@ test("inspecting and filtering audit logs", async ({ page }) => {
3853
await page.goto("/audit");
3954

4055
const user = currentUser(page);
41-
const loginMessage = `${user.username} logged in`;
42-
const startedWorkspaceMessage = `${user.username} started workspace ${workspaceName}`;
4356

4457
// Make sure those things we did all actually show up
4558
await resetSearch(page);
46-
await expect(page.getByText(loginMessage).first()).toBeVisible();
4759
await expect(
4860
page.getByText(`${user.username} created template ${templateName}`),
4961
).toBeVisible();
5062
await expect(
5163
page.getByText(`${user.username} created workspace ${workspaceName}`),
5264
).toBeVisible();
65+
await expect(
66+
page.getByText(`${user.username} started workspace ${workspaceName}`),
67+
).toBeVisible();
5368

5469
// Make sure we can inspect the details of the log item
5570
const createdWorkspace = page.locator(".MuiTableRow-root", {
@@ -62,8 +77,21 @@ test("inspecting and filtering audit logs", async ({ page }) => {
6277
await expect(
6378
createdWorkspace.getByText(`name: "${workspaceName}"`),
6479
).toBeVisible();
80+
});
6581

66-
await expect(page.getByText(startedWorkspaceMessage)).toBeVisible();
82+
test("inspecting and filtering audit logs", async ({ page }) => {
83+
requiresLicense();
84+
85+
// Do some stuff that should show up in the audit logs
86+
const templateName = await createTemplate(page);
87+
const workspaceName = await createWorkspace(page, templateName);
88+
89+
// Go to the audit history
90+
await page.goto("/audit");
91+
92+
const user = currentUser(page);
93+
const loginMessage = `${user.username} logged in`;
94+
const startedWorkspaceMessage = `${user.username} started workspace ${workspaceName}`;
6795

6896
// Filter by resource type
6997
await resetSearch(page);

0 commit comments

Comments
 (0)