@@ -2,60 +2,45 @@ import {test, expect} from '@playwright/test'
2
2
import { visit } from '../test-helpers/storybook'
3
3
import { themes } from '../test-helpers/themes'
4
4
5
- test . describe ( 'Octicon' , ( ) => {
6
- test . describe ( 'Default' , ( ) => {
7
- for ( const theme of themes ) {
8
- test . describe ( theme , ( ) => {
9
- test ( 'default @vrt' , async ( { page} ) => {
10
- await visit ( page , {
11
- id : 'components-octicon--default' ,
12
- globals : {
13
- colorScheme : theme ,
14
- } ,
15
- } )
5
+ const stories = [
6
+ {
7
+ title : 'Default' ,
8
+ id : 'deprecated-components-octicon--default' ,
9
+ } ,
10
+ {
11
+ title : 'Playground' ,
12
+ id : 'deprecated-components-octicon--playground' ,
13
+ } ,
14
+ ] as const
16
15
17
- // Default state
18
- expect ( await page . screenshot ( ) ) . toMatchSnapshot ( `Octicon.Default.${ theme } .png` )
19
- } )
20
-
21
- test ( 'axe @aat' , async ( { page} ) => {
22
- await visit ( page , {
23
- id : 'components-octicon--default' ,
24
- globals : {
25
- colorScheme : theme ,
26
- } ,
27
- } )
28
- await expect ( page ) . toHaveNoViolations ( )
29
- } )
30
- } )
31
- }
32
- } )
16
+ test . describe ( 'Octicon' , ( ) => {
17
+ for ( const story of stories ) {
18
+ test . describe ( story . title , ( ) => {
19
+ for ( const theme of themes ) {
20
+ test . describe ( theme , ( ) => {
21
+ test ( 'default @vrt' , async ( { page} ) => {
22
+ await visit ( page , {
23
+ id : story . id ,
24
+ globals : {
25
+ colorScheme : theme ,
26
+ } ,
27
+ } )
33
28
34
- test . describe ( 'Playground' , ( ) => {
35
- for ( const theme of themes ) {
36
- test . describe ( theme , ( ) => {
37
- test ( 'default @vrt' , async ( { page} ) => {
38
- await visit ( page , {
39
- id : 'components-octicon--playground' ,
40
- globals : {
41
- colorScheme : theme ,
42
- } ,
29
+ // Default state
30
+ expect ( await page . screenshot ( ) ) . toMatchSnapshot ( `Octicon.${ story . title } .${ theme } .png` )
43
31
} )
44
32
45
- // Default state
46
- expect ( await page . screenshot ( ) ) . toMatchSnapshot ( `Octicon.Playground.${ theme } .png` )
47
- } )
48
-
49
- test ( 'axe @aat' , async ( { page} ) => {
50
- await visit ( page , {
51
- id : 'components-octicon--playground' ,
52
- globals : {
53
- colorScheme : theme ,
54
- } ,
33
+ test ( 'axe @aat' , async ( { page} ) => {
34
+ await visit ( page , {
35
+ id : story . id ,
36
+ globals : {
37
+ colorScheme : theme ,
38
+ } ,
39
+ } )
40
+ await expect ( page ) . toHaveNoViolations ( )
55
41
} )
56
- await expect ( page ) . toHaveNoViolations ( )
57
42
} )
58
- } )
59
- }
60
- } )
43
+ }
44
+ } )
45
+ }
61
46
} )
0 commit comments