File tree Expand file tree Collapse file tree 3 files changed +25
-20
lines changed Expand file tree Collapse file tree 3 files changed +25
-20
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ jobs:
27
27
run : npx cypress install
28
28
- name : Install dependecies
29
29
run : pnpm install
30
- - name : Build Package
30
+ - name : Build package
31
31
run : pnpm build
32
- - name : Install Package
32
+ - name : Install package
33
33
run : pnpm install
34
- - name : Test with Cypress
34
+ - name : Run tests
35
35
uses : cypress-io/github-action@v5
36
36
timeout-minutes : 5
37
37
with :
Original file line number Diff line number Diff line change @@ -34,10 +34,13 @@ describe('Callbacks', () => {
34
34
it ( 'onDestroyed callback is called' , ( ) => {
35
35
cy . mountApp ( App )
36
36
37
- . get ( 'body' )
38
- . triggerAppEvent ( 'display-loader' )
39
- . triggerAppEvent ( 'destroy-loader' )
37
+ cy . triggerAppEvent ( 'display-loader' )
40
38
41
- cy . get ( '[data-cy-callback]' ) . should ( 'contain.text' , destroyedText )
39
+ cy . getRoot ( )
40
+ . should ( 'exist' )
41
+ . then ( ( ) => {
42
+ cy . triggerAppEvent ( 'destroy-loader' )
43
+ cy . get ( '[data-cy-callback]' ) . should ( 'contain.text' , destroyedText )
44
+ } )
42
45
} )
43
46
} )
Original file line number Diff line number Diff line change @@ -39,25 +39,27 @@ describe('Scoped Options', () => {
39
39
it ( 'Scoped options are applied to a specific loader and restored on destroy' , ( ) => {
40
40
cy . mountApp ( App )
41
41
42
- . get ( 'body' )
43
- . triggerAppEvent ( 'display-loader' )
42
+ cy . triggerAppEvent ( 'display-loader' )
44
43
45
44
cy . getRoot ( )
46
45
. checkCssVars ( customConf )
47
46
. checkComputedStyles ( customConf )
48
-
49
- . get ( '[aria-live]' )
50
- . should ( 'contain.text' , customConf . screenReaderMessage )
47
+ . within ( ( ) => {
48
+ cy . get ( '[aria-live]' ) . should ( 'contain.text' , customConf . screenReaderMessage )
49
+ } )
51
50
52
51
cy . triggerAppEvent ( 'destroy-loader' )
53
52
54
- cy . triggerAppEvent ( 'display-new-loader' )
55
-
56
- cy . getRoot ( )
57
- . checkCssVars ( DEF )
58
- . checkComputedStyles ( DEF )
59
-
60
- . get ( '[aria-live]' )
61
- . should ( 'contain.text' , DEF . screenReaderMessage )
53
+ cy . get ( '[data-cy-loader]' )
54
+ . should ( 'not.exist' )
55
+ . then ( ( ) => {
56
+ cy . triggerAppEvent ( 'display-new-loader' )
57
+ cy . get ( '[data-cy-loader]' )
58
+ . checkCssVars ( DEF )
59
+ . checkComputedStyles ( DEF )
60
+ . within ( ( ) => {
61
+ cy . get ( '[aria-live]' ) . should ( 'contain.text' , DEF . screenReaderMessage )
62
+ } )
63
+ } )
62
64
} )
63
65
} )
You can’t perform that action at this time.
0 commit comments