@@ -10,68 +10,73 @@ import {
1010
1111const style = { width : '25rem' }
1212
13- describe . each ( [ 'ui' , 'sbanken' ] ) ( 'GlobalStatus for %s' , ( themeName ) => {
14- setupPageScreenshot ( {
15- themeName,
16- url : '/uilib/components/global-status/demos/' ,
17- } )
18-
19- it ( 'have to match the default state with custom content' , async ( ) => {
20- const screenshot = await makeScreenshot ( {
21- style,
22- selector : '[data-visual-test="global-status"] .dnb-global-status' ,
23- } )
24- expect ( screenshot ) . toMatchImageSnapshot ( )
25- } )
26-
27- it ( 'have to match the information state and custom content' , async ( ) => {
28- const screenshot = await makeScreenshot ( {
29- style,
30- selector :
31- '[data-visual-test="global-status-information"] .dnb-global-status' ,
13+ describe . each ( [ 'ui' , 'sbanken' , 'carnegie' ] ) (
14+ 'GlobalStatus for %s' ,
15+ ( themeName ) => {
16+ setupPageScreenshot ( {
17+ themeName,
18+ url : '/uilib/components/global-status/demos/' ,
3219 } )
33- expect ( screenshot ) . toMatchImageSnapshot ( )
34- } )
3520
36- it ( 'have to match the success state and custom content' , async ( ) => {
37- const screenshot = await makeScreenshot ( {
38- style,
39- selector :
40- '[data-visual-test="global-status-success"] .dnb-global-status' ,
21+ it ( 'have to match the default state with custom content' , async ( ) => {
22+ const screenshot = await makeScreenshot ( {
23+ style,
24+ selector : '[data-visual-test="global-status"] .dnb-global-status' ,
25+ } )
26+ expect ( screenshot ) . toMatchImageSnapshot ( )
4127 } )
42- expect ( screenshot ) . toMatchImageSnapshot ( )
43- } )
4428
45- it ( 'have to match the custom icon' , async ( ) => {
46- const screenshot = await makeScreenshot ( {
47- style,
48- selector :
49- '[data-visual-test="global-status-icon"] .dnb-global-status' ,
29+ it ( 'have to match the info state and custom content' , async ( ) => {
30+ const screenshot = await makeScreenshot ( {
31+ style,
32+ selector :
33+ '[data-visual-test="global-status-information"] .dnb-global-status' ,
34+ } )
35+ expect ( screenshot ) . toMatchImageSnapshot ( )
5036 } )
51- expect ( screenshot ) . toMatchImageSnapshot ( )
52- } )
5337
54- if ( themeName !== 'sbanken' ) {
55- it ( 'have to match the close button in focus state' , async ( ) => {
38+ it ( 'have to match the success state and custom content' , async ( ) => {
5639 const screenshot = await makeScreenshot ( {
5740 style,
58- selector : '[data-visual-test="global-status"] .dnb-global-status' ,
59- simulateSelector :
60- '[data-visual-test="global-status"] .dnb-global-status__close-button' ,
61- simulate : 'focus' ,
41+ selector :
42+ '[data-visual-test="global-status-success"] .dnb-global-status' ,
6243 } )
6344 expect ( screenshot ) . toMatchImageSnapshot ( )
6445 } )
6546
66- it ( 'have to match the close button in hover state ' , async ( ) => {
47+ it ( 'have to match the custom icon ' , async ( ) => {
6748 const screenshot = await makeScreenshot ( {
6849 style,
69- selector : '[data-visual-test="global-status"] .dnb-global-status' ,
70- simulateSelector :
71- '[data-visual-test="global-status"] .dnb-global-status__close-button' ,
72- simulate : 'hover' ,
50+ selector :
51+ '[data-visual-test="global-status-icon"] .dnb-global-status' ,
7352 } )
7453 expect ( screenshot ) . toMatchImageSnapshot ( )
7554 } )
55+
56+ if ( themeName !== 'sbanken' ) {
57+ it ( 'have to match the close button in focus state' , async ( ) => {
58+ const screenshot = await makeScreenshot ( {
59+ style,
60+ selector :
61+ '[data-visual-test="global-status"] .dnb-global-status' ,
62+ simulateSelector :
63+ '[data-visual-test="global-status"] .dnb-global-status__close-button' ,
64+ simulate : 'focus' ,
65+ } )
66+ expect ( screenshot ) . toMatchImageSnapshot ( )
67+ } )
68+
69+ it ( 'have to match the close button in hover state' , async ( ) => {
70+ const screenshot = await makeScreenshot ( {
71+ style,
72+ selector :
73+ '[data-visual-test="global-status"] .dnb-global-status' ,
74+ simulateSelector :
75+ '[data-visual-test="global-status"] .dnb-global-status__close-button' ,
76+ simulate : 'hover' ,
77+ } )
78+ expect ( screenshot ) . toMatchImageSnapshot ( )
79+ } )
80+ }
7681 }
77- } )
82+ )
0 commit comments