Skip to content

Commit f33a1bd

Browse files
committed
4565: Applied coding standards
1 parent bb7976e commit f33a1bd

12 files changed

+163
-56
lines changed

assets/tests/admin/admin-campaign.spec.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { test, expect } from "@playwright/test";
2-
import { fulfillDataRoute, fulfillEmptyRoutes, beforeEachTest, loginTest } from "./test-helper.js";
2+
import {
3+
fulfillDataRoute,
4+
fulfillEmptyRoutes,
5+
beforeEachTest,
6+
loginTest,
7+
} from "./test-helper.js";
38
import { slidesJson1 } from "./data-fixtures.js";
49

510
test.describe("Campaign pages work", () => {
@@ -10,7 +15,11 @@ test.describe("Campaign pages work", () => {
1015
test.beforeEach(async ({ page }) => {
1116
await loginTest(page);
1217

13-
await fulfillEmptyRoutes(page, ["**/playlists*", "**/screens*", "**/screen-groups*"]);
18+
await fulfillEmptyRoutes(page, [
19+
"**/playlists*",
20+
"**/screens*",
21+
"**/screen-groups*",
22+
]);
1423

1524
await page.locator(".sidebar-nav .nav-link").getByText("Kampagner").click();
1625
await expect(page.locator("h1").getByText("Kampagner")).toBeVisible();

assets/tests/admin/admin-feed-sources.spec.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ import {
33
errorJson,
44
feedSourcesJson,
55
feedSourcesJson2,
6-
feedSourceSingleJson
6+
feedSourceSingleJson,
77
} from "./data-fixtures.js";
8-
import { fulfillDataRoute, fulfillEmptyRoutes, beforeEachTest, loginTest } from "./test-helper.js";
8+
import {
9+
fulfillDataRoute,
10+
fulfillEmptyRoutes,
11+
beforeEachTest,
12+
loginTest,
13+
} from "./test-helper.js";
914

1015
test.describe("feed sources", () => {
1116
test.beforeEach(async ({ page }) => {
@@ -72,7 +77,11 @@ test.describe("feed sources", () => {
7277
await expect(page.locator("#feed-sourceTitle")).not.toBeVisible();
7378

7479
await fulfillDataRoute(page, "**/feed-sources*", feedSourcesJson2);
75-
await fulfillDataRoute(page, "**/feed-sources/01JBBP48CS9CV80XRWRP8CAETJ", feedSourceSingleJson);
80+
await fulfillDataRoute(
81+
page,
82+
"**/feed-sources/01JBBP48CS9CV80XRWRP8CAETJ",
83+
feedSourceSingleJson,
84+
);
7685

7786
await page.locator("tbody").locator("tr td a").first().click();
7887
await expect(page.locator("#feed-sourceTitle")).toBeVisible();

assets/tests/admin/admin-login.spec.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ import { test, expect } from "@playwright/test";
22
import {
33
accessConfigJson,
44
adminConfigJson,
5-
emptyJson, tokenAdminJson, tokenEditorJson, tokenTenantsJson
5+
emptyJson,
6+
tokenAdminJson,
7+
tokenEditorJson,
8+
tokenTenantsJson,
69
} from "./data-fixtures.js";
7-
import { fulfillDataRoute, fulfillEmptyRoutes, beforeEachTest } from "./test-helper.js";
10+
import {
11+
fulfillDataRoute,
12+
fulfillEmptyRoutes,
13+
beforeEachTest,
14+
} from "./test-helper.js";
815

916
test.describe("Login works", () => {
1017
test.beforeEach(async ({ page }) => {

assets/tests/admin/admin-playlist.spec.js

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { test, expect } from "@playwright/test";
2-
import { beforeEachTest, fulfillDataRoute, fulfillEmptyRoutes, loginTest } from "./test-helper.js";
3-
import { emptyJson, errorJson, playlistListJson, onSaveJson, playlistSingleJson } from "./data-fixtures.js";
2+
import {
3+
beforeEachTest,
4+
fulfillDataRoute,
5+
fulfillEmptyRoutes,
6+
loginTest,
7+
} from "./test-helper.js";
8+
import {
9+
emptyJson,
10+
errorJson,
11+
playlistListJson,
12+
onSaveJson,
13+
playlistSingleJson,
14+
} from "./data-fixtures.js";
415

516
test.describe("Playlist create tests", () => {
617
test.beforeEach(async ({ page }) => {
@@ -25,15 +36,15 @@ test.describe("Playlist create tests", () => {
2536

2637
// Displays success toast and redirects
2738
await expect(
28-
page.locator(".Toastify").locator(".Toastify__toast--success")
39+
page.locator(".Toastify").locator(".Toastify__toast--success"),
2940
).not.toBeVisible();
3041
await page.locator("#save_slide_and_close").click();
3142
await expect(
3243
page
3344
.locator(".Toastify")
3445
.locator(".Toastify__toast--success")
3546
.getByText(/gemt/)
36-
.first()
47+
.first(),
3748
).toBeVisible();
3849
await expect(page).toHaveURL(/playlist\/list/);
3950
});
@@ -43,18 +54,18 @@ test.describe("Playlist create tests", () => {
4354

4455
// Displays error toast and stays on page
4556
await expect(
46-
page.locator(".Toastify").locator(".Toastify__toast--error")
57+
page.locator(".Toastify").locator(".Toastify__toast--error"),
4758
).not.toBeVisible();
4859
await page.locator("#save_playlist").click();
4960
await expect(
50-
page.locator(".Toastify").locator(".Toastify__toast--error")
61+
page.locator(".Toastify").locator(".Toastify__toast--error"),
5162
).toBeVisible();
5263
await expect(
5364
page
5465
.locator(".Toastify")
5566
.locator(".Toastify__toast--error")
5667
.getByText(/An error occurred/)
57-
.first()
68+
.first(),
5869
).toBeVisible();
5970
await expect(page).toHaveURL(/playlist\/create/);
6071
});
@@ -79,12 +90,14 @@ test.describe("Playlist list tests", () => {
7990
await fulfillEmptyRoutes(page, ["**/tenants*"]);
8091

8192
await page.getByRole("link", { name: "Spillelister", exact: true }).click();
82-
await expect(page.getByRole("heading", { name: "Spillelister", exact: true })).toBeVisible();
93+
await expect(
94+
page.getByRole("heading", { name: "Spillelister", exact: true }),
95+
).toBeVisible();
8396
});
8497

8598
test("It loads playlist list", async ({ page }) => {
8699
await expect(
87-
page.locator("table").locator("tbody").first()
100+
page.locator("table").locator("tbody").first(),
88101
).not.toBeEmpty();
89102
await expect(page.locator("tbody").locator("tr td").first()).toBeVisible();
90103
});
@@ -97,8 +110,9 @@ test.describe("Playlist list tests", () => {
97110
await expect(page.locator("#playlistTitle")).toBeVisible();
98111
});
99112

100-
test("The correct amount of column headers loaded (playlist list)",
101-
async ({ page }) => {
102-
await expect(page.locator("thead").locator("th")).toHaveCount(8);
103-
});
113+
test("The correct amount of column headers loaded (playlist list)", async ({
114+
page,
115+
}) => {
116+
await expect(page.locator("thead").locator("th")).toHaveCount(8);
117+
});
104118
});

assets/tests/admin/admin-screen-groups.spec.js

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { test, expect } from "@playwright/test";
2-
import { beforeEachTest, fulfillDataRoute, fulfillEmptyRoutes, loginTest } from "./test-helper.js";
2+
import {
3+
beforeEachTest,
4+
fulfillDataRoute,
5+
fulfillEmptyRoutes,
6+
loginTest,
7+
} from "./test-helper.js";
38
import {
49
playlistListJson,
510
onSaveJson,
611
errorJson,
712
screenGroupsListJson,
8-
screenGroupsSingleJson
13+
screenGroupsSingleJson,
914
} from "./data-fixtures.js";
1015
import { json } from "react-router-dom";
1116

@@ -20,9 +25,15 @@ test.describe("Create group page works", () => {
2025
await fulfillEmptyRoutes(page, ["**/screen-groups*"]);
2126

2227
await page.getByRole("link", { name: "Grupper", exact: true }).click();
23-
await expect(page.getByRole("heading", { name: "Grupper", exact: true })).toBeVisible();
24-
await page.getByRole("button", { name: "Opret ny gruppe", exact: true }).click();
25-
await expect(page.getByRole("heading", { name: "Opret ny gruppe", exact: true })).toBeVisible();
28+
await expect(
29+
page.getByRole("heading", { name: "Grupper", exact: true }),
30+
).toBeVisible();
31+
await page
32+
.getByRole("button", { name: "Opret ny gruppe", exact: true })
33+
.click();
34+
await expect(
35+
page.getByRole("heading", { name: "Opret ny gruppe", exact: true }),
36+
).toBeVisible();
2637
});
2738

2839
test("It loads create group page", async ({ page }) => {
@@ -76,11 +87,13 @@ test.describe("Groups list works", () => {
7687
test.beforeEach(async ({ page }) => {
7788
await loginTest(page);
7889

79-
await fulfillEmptyRoutes(page, ['**/screens*']);
90+
await fulfillEmptyRoutes(page, ["**/screens*"]);
8091
await fulfillDataRoute(page, "**/screen-groups*", screenGroupsListJson);
8192

8293
await page.getByRole("link", { name: "Grupper", exact: true }).click();
83-
await expect(page.getByRole("heading", { name: "Grupper", exact: true })).toBeVisible();
94+
await expect(
95+
page.getByRole("heading", { name: "Grupper", exact: true }),
96+
).toBeVisible();
8497
});
8598

8699
test("It loads groups list", async ({ page }) => {
@@ -89,7 +102,11 @@ test.describe("Groups list works", () => {
89102
});
90103

91104
test("It goes to edit (groups list)", async ({ page }) => {
92-
await fulfillDataRoute(page, "**/screen-groups/000RAH746Q1AD8011Z1JNV06N3", screenGroupsSingleJson);
105+
await fulfillDataRoute(
106+
page,
107+
"**/screen-groups/000RAH746Q1AD8011Z1JNV06N3",
108+
screenGroupsSingleJson,
109+
);
93110

94111
await expect(page.locator("#groupTitle")).not.toBeVisible();
95112
await page.locator("tbody").locator("tr td a").nth(0).click();

assets/tests/admin/admin-screens.spec.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import { test, expect } from "@playwright/test";
2-
import { adminConfigJson, screenGroupsListJson, screensListJson } from "./data-fixtures.js";
3-
import { beforeEachTest, fulfillDataRoute, fulfillEmptyRoutes, loginTest } from "./test-helper.js";
2+
import {
3+
adminConfigJson,
4+
screenGroupsListJson,
5+
screensListJson,
6+
} from "./data-fixtures.js";
7+
import {
8+
beforeEachTest,
9+
fulfillDataRoute,
10+
fulfillEmptyRoutes,
11+
loginTest,
12+
} from "./test-helper.js";
413

514
test.describe("Screen", () => {
615
test.beforeEach(async ({ page }) => {
@@ -12,10 +21,16 @@ test.describe("Screen", () => {
1221

1322
await fulfillDataRoute(page, "**/screens*", screensListJson);
1423

15-
await fulfillEmptyRoutes(page, ["**/campaigns*", "**/screen-groups*", "**/layouts*"]);
24+
await fulfillEmptyRoutes(page, [
25+
"**/campaigns*",
26+
"**/screen-groups*",
27+
"**/layouts*",
28+
]);
1629

1730
await page.getByRole("link", { name: "Skærme", exact: true }).click();
18-
await expect(page.getByRole("heading", { name: "Skærme", exact: true })).toBeVisible();
31+
await expect(
32+
page.getByRole("heading", { name: "Skærme", exact: true }),
33+
).toBeVisible();
1934
});
2035

2136
test("Loads list", async ({ page }) => {

assets/tests/admin/admin-shared-list.spec.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { test, expect } from "@playwright/test";
2-
import { beforeEachTest, fulfillDataRoute, fulfillEmptyRoutes, loginTest } from "./test-helper.js";
2+
import {
3+
beforeEachTest,
4+
fulfillDataRoute,
5+
fulfillEmptyRoutes,
6+
loginTest,
7+
} from "./test-helper.js";
38
import { playlistListJson, screensListJson } from "./data-fixtures.js";
49

510
test.describe("Shared list tests", () => {
@@ -12,8 +17,12 @@ test.describe("Shared list tests", () => {
1217

1318
await fulfillDataRoute(page, "**/playlists*", playlistListJson);
1419

15-
await page.getByRole("link", { name: "Delte spillelister", exact: true }).click();
16-
await expect(page.getByRole("heading", { name: "Delte spillelister", exact: true })).toBeVisible();
20+
await page
21+
.getByRole("link", { name: "Delte spillelister", exact: true })
22+
.click();
23+
await expect(
24+
page.getByRole("heading", { name: "Delte spillelister", exact: true }),
25+
).toBeVisible();
1726
});
1827

1928
test("It loads shared playlist list", async ({ page }) => {

assets/tests/admin/admin-slides.spec.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { test, expect } from "@playwright/test";
2-
import { beforeEachTest, fulfillDataRoute, fulfillEmptyRoutes, loginTest } from "./test-helper.js";
3-
import { emptyJson, errorJson, slidesListJson, templatesListJson } from "./data-fixtures.js";
2+
import {
3+
beforeEachTest,
4+
fulfillDataRoute,
5+
fulfillEmptyRoutes,
6+
loginTest,
7+
} from "./test-helper.js";
8+
import {
9+
emptyJson,
10+
errorJson,
11+
slidesListJson,
12+
templatesListJson,
13+
} from "./data-fixtures.js";
414

515
test.describe("Slide create", () => {
616
test.beforeEach(async ({ page }) => {

assets/tests/admin/admin-theme.spec.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { test, expect } from "@playwright/test";
2-
import { beforeEachTest, fulfillDataRoute, fulfillEmptyRoutes, loginTest } from "./test-helper.js";
3-
import { errorJson, feedSourcesJson2, screensListJson, themesJson, themesSingleJson } from "./data-fixtures.js";
2+
import {
3+
beforeEachTest,
4+
fulfillDataRoute,
5+
fulfillEmptyRoutes,
6+
loginTest,
7+
} from "./test-helper.js";
8+
import {
9+
errorJson,
10+
feedSourcesJson2,
11+
screensListJson,
12+
themesJson,
13+
themesSingleJson,
14+
} from "./data-fixtures.js";
415

516
test.describe("Theme", () => {
617
test.beforeEach(async ({ page }) => {
@@ -11,10 +22,12 @@ test.describe("Theme", () => {
1122
await loginTest(page);
1223

1324
await fulfillDataRoute(page, "**/themes*", themesJson);
14-
// await fulfillEmptyRoutes(page, ["**/campaigns*", "**/screen-groups*", "**/layouts*"]);
25+
// await fulfillEmptyRoutes(page, ["**/campaigns*", "**/screen-groups*", "**/layouts*"]);
1526

1627
await page.getByRole("link", { name: "Temaer", exact: true }).click();
17-
await expect(page.getByRole("heading", { name: "Temaer", exact: true })).toBeVisible();
28+
await expect(
29+
page.getByRole("heading", { name: "Temaer", exact: true }),
30+
).toBeVisible();
1831
});
1932

2033
test("It loads create theme page", async ({ page }) => {

assets/tests/admin/admin-top-bar.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { test, expect } from "@playwright/test";
2-
import { beforeEachTest, fulfillEmptyRoutes, loginTest } from "./test-helper.js";
2+
import {
3+
beforeEachTest,
4+
fulfillEmptyRoutes,
5+
loginTest,
6+
} from "./test-helper.js";
37
import { emptyJson } from "./data-fixtures.js";
48

59
test.describe("Nav items loads", () => {

0 commit comments

Comments
 (0)