@@ -112,9 +112,38 @@ describe("Form with Accordion Container", () => {
112112 cy . get ( `#${ firstChildComponentItemId } ` ) . should ( 'not.have.attr' , 'data-cmp-expanded' ) ;
113113 cy . get ( `#${ firstChildComponentButtonId } ` ) . should ( 'not.have.class' , 'cmp-accordion__button--expanded' ) ;
114114 cy . get ( `#${ firstChildComponentPanelId } ` ) . should ( 'not.have.class' , 'cmp-accordion__panel--expanded' ) ;
115+
116+ cy . get ( `#${ firstChildComponentButtonId } ` ) . click ( ) . then ( ( ) => {
117+ cy . get ( `#${ firstChildComponentButtonId } ` ) . should ( 'have.class' , 'cmp-accordion__button--expanded' ) ;
118+ cy . get ( `#${ firstChildComponentButtonId } ` ) . should ( 'have.attr' , 'aria-controls' , firstChildComponentPanelId ) ;
119+ cy . get ( `#${ firstChildComponentItemId } ` ) . should ( 'have.attr' , 'data-cmp-expanded' ) ;
120+ cy . get ( `#${ firstChildComponentPanelId } ` ) . should ( 'have.class' , 'cmp-accordion__panel--expanded' ) ;
121+ cy . get ( `#${ firstChildComponentPanelId } ` ) . should ( 'have.attr' , 'aria-labelledby' , firstChildComponentButtonId ) ;
122+
123+ cy . get ( `#${ secondChildComponentItemId } ` ) . should ( 'not.have.attr' , 'data-cmp-expanded' ) ;
124+ cy . get ( `#${ secondChildComponentButtonId } ` ) . should ( 'not.have.class' , 'cmp-accordion__button--expanded' ) ;
125+ cy . get ( `#${ secondChildComponentPanelId } ` ) . should ( 'not.have.class' , 'cmp-accordion__panel--expanded' ) ;
126+
127+ cy . get ( `#${ firstChildComponentButtonId } ` ) . click ( ) . then ( ( ) => {
128+ cy . get ( `#${ firstChildComponentButtonId } ` ) . should ( 'not.have.class' , 'cmp-accordion__button--expanded' ) ;
129+ cy . get ( `#${ firstChildComponentItemId } ` ) . should ( 'not.have.attr' , 'data-cmp-expanded' ) ;
130+ cy . get ( `#${ secondChildComponentItemId } ` ) . should ( 'not.have.attr' , 'data-cmp-expanded' ) ;
131+ cy . get ( `#${ secondChildComponentButtonId } ` ) . should ( 'not.have.class' , 'cmp-accordion__button--expanded' ) ;
132+ cy . get ( `#${ secondChildComponentPanelId } ` ) . should ( 'not.have.class' , 'cmp-accordion__panel--expanded' ) ;
133+
134+ cy . get ( `#${ firstChildComponentButtonId } ` ) . click ( ) . then ( ( ) => {
135+ cy . get ( `#${ firstChildComponentButtonId } ` ) . should ( 'have.class' , 'cmp-accordion__button--expanded' ) ;
136+ cy . get ( `#${ firstChildComponentButtonId } ` ) . should ( 'have.attr' , 'aria-controls' , firstChildComponentPanelId ) ;
137+ cy . get ( `#${ firstChildComponentItemId } ` ) . should ( 'have.attr' , 'data-cmp-expanded' ) ;
138+ cy . get ( `#${ firstChildComponentPanelId } ` ) . should ( 'have.class' , 'cmp-accordion__panel--expanded' ) ;
139+ cy . get ( `#${ firstChildComponentPanelId } ` ) . should ( 'have.attr' , 'aria-labelledby' , firstChildComponentButtonId ) ;
140+ } ) ;
141+ } ) ;
142+
143+ } ) ;
115144 } ) ;
116- } )
117- } )
145+ } ) ;
146+ } ) ;
118147
119148 it ( "should collapse/expand view properly with keyboard" , ( ) => {
120149
@@ -276,4 +305,4 @@ describe("Form with Accordion Layout Container with Hidden Children", () => {
276305 cy . get ( `#${ thirdPanelButtonOfAccordionId } ` ) . should ( 'have.class' , 'cmp-accordion__button--expanded' ) ;
277306 } )
278307 } ) ;
279- } ) ;
308+ } ) ;
0 commit comments