Skip to content

Commit

Permalink
1859: Fixed tests and vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Aug 1, 2024
1 parent cf1e09e commit 8dbe057
Show file tree
Hide file tree
Showing 12 changed files with 302 additions and 299 deletions.
2 changes: 1 addition & 1 deletion e2e/campaign.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";

test.describe("Campaign pages work", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/campaign/create");
await page.goto("/admin/campaign/create");
await page.route("**/slides*", async (route) => {
const json = {
"@id": "/v2/slides",
Expand Down
12 changes: 6 additions & 6 deletions e2e/login.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test.describe("Login works", () => {
await route.fulfill({ json });
});

await page.goto("/playlist/list");
await page.goto("/admin/playlist/list");
await page.locator("#login").click();
await expect(page.locator(".name")).toHaveText("John Doe");
});
Expand Down Expand Up @@ -59,14 +59,14 @@ test.describe("Login works", () => {
};
await route.fulfill({ json });
});
await page.goto("/group/list");
await page.goto("/admin/group/list");
await page.locator("#login").click();
// Expect dropdown with tenants
await expect(page.locator(".dropdown-container")).toBeVisible();
});

test("Login with tenant that has role editor", async ({ page }) => {
await page.goto("/playlist/list");
await page.goto("/admin/playlist/list");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand All @@ -87,7 +87,7 @@ test.describe("Login works", () => {
await route.fulfill({ json });
});

await page.goto("/group/list");
await page.goto("/admin/group/list");
await page.locator("#login").click();
await expect(page.locator(".name")).toHaveText("John Doe");
await expect(page.locator(".sidebar-nav").locator(".nav-item")).toHaveCount(
Expand All @@ -98,7 +98,7 @@ test.describe("Login works", () => {
test("Role editor should not be able to visit restricted route", async ({
page,
}) => {
await page.goto("/playlist/list");
await page.goto("/admin/playlist/list");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand All @@ -118,7 +118,7 @@ test.describe("Login works", () => {
};
await route.fulfill({ json });
});
await page.goto("/shared/list");
await page.goto("/admin/shared/list");
await page.locator("#login").click();
await expect(page.locator("main").locator("div")).toHaveText(
"Du har ikke adgang til denne side"
Expand Down
2 changes: 1 addition & 1 deletion e2e/media.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";

test.describe("media list tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/media/list");
await page.goto("/admin/media/list");
await page.route("**/media*", async (route) => {
const json = {
"@context": "/contexts/Media",
Expand Down
4 changes: 2 additions & 2 deletions e2e/playlist.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";

test.describe("Playlist create tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/playlist/create");
await page.goto("/admin/playlist/create");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand Down Expand Up @@ -107,7 +107,7 @@ test.describe("Playlist create tests", () => {
});
test.describe("Playlist list tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/playlist/list");
await page.goto("/admin/playlist/list");
await page.route("**/playlists*", async (route) => {
const json = {
"@context": "/contexts/Playlist",
Expand Down
4 changes: 2 additions & 2 deletions e2e/screen-groups.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";

test.describe("Create group page works", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/group/create");
await page.goto("/admin/group/create");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand Down Expand Up @@ -91,7 +91,7 @@ test.describe("Create group page works", () => {

test.describe("Groups list works", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/group/list");
await page.goto("/admin/group/list");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand Down
4 changes: 2 additions & 2 deletions e2e/screens.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";

test.describe("Screen list tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/screen/list");
await page.goto("/admin/screen/list");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand Down Expand Up @@ -121,7 +121,7 @@ test.describe("Screen list tests", () => {

test.describe("Screen create tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/screen/create");
await page.goto("/admin/screen/create");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand Down
2 changes: 1 addition & 1 deletion e2e/shared-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";

test.describe("Shared list tests", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/shared/list");
await page.goto("/admin/shared/list");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand Down
4 changes: 2 additions & 2 deletions e2e/slides.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test";

test.describe("Create slide page works", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/slide/create");
await page.goto("/admin/slide/create");
await page.route("**/token", async (route) => {
const json = {
token: "1",
Expand Down Expand Up @@ -163,7 +163,7 @@ test.describe("Create slide page works", () => {

test.describe("Slides list works", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/slide/list");
await page.goto("/admin/slide/list");
await page.route("**/slides*", async (route) => {
const json = {
"@id": "/v2/slides",
Expand Down
Loading

0 comments on commit 8dbe057

Please sign in to comment.