11import { 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
516test . 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 ( / g e m t / )
36- . first ( )
47+ . first ( ) ,
3748 ) . toBeVisible ( ) ;
3849 await expect ( page ) . toHaveURL ( / p l a y l i s t \/ l i s t / ) ;
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 ( / A n e r r o r o c c u r r e d / )
57- . first ( )
68+ . first ( ) ,
5869 ) . toBeVisible ( ) ;
5970 await expect ( page ) . toHaveURL ( / p l a y l i s t \/ c r e a t e / ) ;
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} ) ;
0 commit comments