@@ -6,3 +6,82 @@ test("Test template index", async ({ page }) => {
6
6
await expect ( page ) . toHaveTitle ( / O S 2 D i s p l a y T e m p l a t e s / ) ;
7
7
await expect ( page . getByText ( "Examples" ) ) . toBeVisible ( ) ;
8
8
} ) ;
9
+
10
+ test . describe ( "Template Links" , ( ) => {
11
+ test . beforeEach ( async ( { page } ) => {
12
+ await page . goto ( "/template" ) ;
13
+ } ) ;
14
+
15
+ test ( "Should display all templates with links" , async ( { page } ) => {
16
+ const templateIds = [
17
+ "book-review-0" ,
18
+ "calendar-0-multiple-days" ,
19
+ "calendar-1-multiple" ,
20
+ "calendar-2-single" ,
21
+ "calendar-3-multiple-days" ,
22
+ "calendar-4-single-booking" ,
23
+ "contacts-underlined" ,
24
+ "contacts-not-underlined" ,
25
+ "iframe-0" ,
26
+ "image-text-0" ,
27
+ "image-text-1" ,
28
+ "image-text-1-multiple-images" ,
29
+ "image-text-2-logo" ,
30
+ "image-text-3-font-sizes" ,
31
+ "image-text-reversed" ,
32
+ "image-text-4-test-theme" ,
33
+ "instagram-0" ,
34
+ "instagram-1-no-max-entries" ,
35
+ "news-feed-0" ,
36
+ "poster-0-single" ,
37
+ "poster-0-single-override" ,
38
+ "poster-1-subscription" ,
39
+ "poster-2-single-no-feed" ,
40
+ "rss-0-no-feed-progress" ,
41
+ "rss-1-with-progress" ,
42
+ "slideshow-0" ,
43
+ "slideshow-1-no-stuff" ,
44
+ "slideshow-2" ,
45
+ "table-0" ,
46
+ "table-1" ,
47
+ "travel-multiple-stations" ,
48
+ "travel-spacious-info-box" ,
49
+ "travel-one-station" ,
50
+ "video-0" ,
51
+ "vimeo-player-0" ,
52
+ ] ;
53
+
54
+ for ( const id of templateIds ) {
55
+ const link = page . locator ( `#${ id } a` ) ;
56
+ await expect ( link ) . toBeVisible ( ) ;
57
+ await expect ( link ) . toHaveAttribute ( "href" , `/template/${ id } ` ) ;
58
+ }
59
+ } ) ;
60
+
61
+ test ( "Should display all screen templates with links" , async ( { page } ) => {
62
+ const screenTemplateIds = [
63
+ "two-split" ,
64
+ "two-split-vertical" ,
65
+ "two-split-vertical-reversed" ,
66
+ "touch-template" ,
67
+ "three-split" ,
68
+ "three-split-horizontal" ,
69
+ "six-areas" ,
70
+ "full-screen" ,
71
+ "four-areas" ,
72
+ ] ;
73
+
74
+ for ( const id of screenTemplateIds ) {
75
+ const link = page . locator ( `#${ id } a` ) ;
76
+ await expect ( link ) . toBeVisible ( ) ;
77
+ await expect ( link ) . toHaveAttribute ( "href" , `/template/${ id } ` ) ;
78
+ }
79
+ } ) ;
80
+
81
+ test ( "Should have working navigation for one of the links" , async ( {
82
+ page,
83
+ } ) => {
84
+ await page . click ( "#book-review-0 a" ) ;
85
+ await expect ( page ) . toHaveURL ( / \/ t e m p l a t e \/ b o o k - r e v i e w - 0 $ / ) ;
86
+ } ) ;
87
+ } ) ;
0 commit comments