@@ -124,13 +124,29 @@ describe('UI5 Web Components - Child Commands', () => {
124124
125125 it ( 'click list item' , ( ) => {
126126 cy . mount (
127- < List selectionMode = "Multiple" >
128- < ListItemStandard data-testid = "s" text = "ListItemStandard" />
129- < ListItemCustom data-testid = "c" > ListItemCustom</ ListItemCustom >
130- </ List >
127+ < >
128+ < List selectionMode = "Multiple" data-testid = "list" >
129+ < ListItemStandard data-testid = "li1" text = "ListItemStandard" />
130+ < ListItemStandard data-testid = "li2" > ListItemStandard2</ ListItemStandard >
131+ < ListItemCustom data-testid = "li3" > ListItemCustom</ ListItemCustom >
132+ </ List >
133+ </ >
131134 ) ;
132- cy . findByText ( 'ListItemStandard' ) . click ( ) ;
133- cy . findByTestId ( 'c' ) . click ( ) ;
135+ cy . clickUi5ListItemByText ( 'ListItemStandard' ) ;
136+ cy . clickUi5ListItemByText ( 'ListItemStandard2' ) ;
137+ cy . clickUi5ListItemByText ( 'ListItemCustom' ) ;
138+
139+ cy . findByTestId ( 'li1' ) . should ( 'have.attr' , 'selected' , 'selected' ) ;
140+ cy . findByTestId ( 'li2' ) . should ( 'have.attr' , 'selected' , 'selected' ) ;
141+ cy . findByTestId ( 'li3' ) . should ( 'have.attr' , 'selected' , 'selected' ) ;
142+
143+ cy . get ( '[ui5-list]' ) . clickUi5ListItemByText ( 'ListItemStandard' ) ;
144+ cy . get ( '[ui5-list]' ) . clickUi5ListItemByText ( 'ListItemStandard2' ) ;
145+ cy . get ( '[ui5-list]' ) . clickUi5ListItemByText ( 'ListItemCustom' ) ;
146+
147+ cy . findByTestId ( 'li1' ) . should ( 'not.have.attr' , 'selected' ) ;
148+ cy . findByTestId ( 'li2' ) . should ( 'not.have.attr' , 'selected' ) ;
149+ cy . findByTestId ( 'li3' ) . should ( 'not.have.attr' , 'selected' ) ;
134150 } ) ;
135151
136152 // TODO figure out how to re-enable this test. Currently the popover directly closes after any interaction with the component.
0 commit comments