@@ -76,29 +76,29 @@ describe('Form', () => {
76
76
it ( 'size S - labels and fields should cover full width' , ( ) => {
77
77
cy . viewport ( 393 , 852 ) ; // iPhone 14 Pro
78
78
cy . mount ( component ) ;
79
- cy . findByText ( ' item 1: ') . should ( 'have.css' , 'grid-column' , '1 / span 12' ) ;
79
+ cy . get ( '[ui5-label]' ) . contains ( ' item 1') . should ( 'have.css' , 'grid-column' , '1 / span 12' ) ;
80
80
cy . findByTestId ( 'formInput' ) . parent ( ) . should ( 'have.css' , 'grid-column' , '1 / span 12' ) ;
81
81
} ) ;
82
82
83
83
it ( 'size M - label should cover 2/12, field 10/12' , ( ) => {
84
84
cy . viewport ( 834 , 1194 ) ; // iPad Pro
85
85
cy . mount ( component ) ;
86
- cy . findByText ( ' item 1: ') . should ( 'have.css' , 'grid-column' , '1 / span 2' ) ;
86
+ cy . get ( '[ui5-label]' ) . contains ( ' item 1') . should ( 'have.css' , 'grid-column' , '1 / span 2' ) ;
87
87
cy . findByTestId ( 'formInput' ) . parent ( ) . should ( 'have.css' , 'grid-column' , '3 / span 10' ) ;
88
88
} ) ;
89
89
90
90
it ( 'size L - label should cover 1/3, field 2/3' , ( ) => {
91
91
cy . viewport ( 1280 , 1024 ) ;
92
92
cy . mount ( component ) ;
93
- cy . findByText ( ' item 1: ') . should ( 'have.css' , 'grid-column' , '1 / span 4' ) ;
93
+ cy . get ( '[ui5-label]' ) . contains ( ' item 1') . should ( 'have.css' , 'grid-column' , '1 / span 4' ) ;
94
94
cy . findByTestId ( 'formInput' ) . parent ( ) . should ( 'have.css' , 'grid-column' , '5 / span 8' ) ;
95
95
} ) ;
96
96
97
97
it ( 'size XL - render two columns with 1/3 and 2/3 each' , ( ) => {
98
98
cy . viewport ( 1920 , 1080 ) ;
99
99
cy . mount ( component ) ;
100
- cy . findByText ( ' item 1: ') . should ( 'have.css' , 'grid-column' , '1 / span 4' ) ;
101
- cy . findByText ( ' item 3: ') . should ( 'have.css' , 'grid-column' , '13 / span 4' ) ;
100
+ cy . get ( '[ui5-label]' ) . contains ( ' item 1') . should ( 'have.css' , 'grid-column' , '1 / span 4' ) ;
101
+ cy . get ( '[ui5-label]' ) . contains ( ' item 3') . should ( 'have.css' , 'grid-column' , '13 / span 4' ) ;
102
102
cy . findByTestId ( 'formInput' ) . parent ( ) . should ( 'have.css' , 'grid-column' , '5 / span 8' ) ;
103
103
cy . findByTestId ( 'formInput2' ) . parent ( ) . should ( 'have.css' , 'grid-column' , '17 / span 8' ) ;
104
104
} ) ;
@@ -117,8 +117,8 @@ describe('Form', () => {
117
117
it ( 'a11y labels' , ( ) => {
118
118
cy . mount ( component ) ;
119
119
for ( let i = 1 ; i <= 3 ; i ++ ) {
120
- cy . findByText ( `item ${ i } ` ) . should ( 'exist' ) . should ( 'not.be.visible' ) ;
121
- cy . findByText ( `item ${ i } : ` ) . should ( 'be.visible' ) ;
120
+ cy . get ( 'label' ) . contains ( `item ${ i } ` ) . should ( 'exist' ) . should ( 'not.be.visible' ) ;
121
+ cy . get ( '[ui5-label]' ) . contains ( `item ${ i } ` ) . should ( 'be.visible' ) ;
122
122
}
123
123
// custom `Label`
124
124
cy . findAllByText ( `item 4` ) . eq ( 0 ) . should ( 'be.visible' ) ;
@@ -137,16 +137,16 @@ describe('Form', () => {
137
137
</ FormItem >
138
138
</ Form >
139
139
) ;
140
- cy . findByText ( ' Portal: ') . should ( 'be.visible' ) ;
140
+ cy . get ( '[ui5-label]' ) . contains ( ' Portal') . should ( 'be.visible' ) ;
141
141
cy . findByTestId ( 'notSupported' ) . should ( 'not.exist' ) ;
142
142
} ) ;
143
143
144
144
it ( 'conditionally render FormItems & FormGroups' , ( ) => {
145
145
cy . mount ( < ConditionRenderingExample /> ) ;
146
- cy . findByText ( 'Item 2' ) . should ( 'not.exist' ) ;
146
+ cy . findAllByText ( 'Item 2' ) . should ( 'not.exist' ) ;
147
147
148
148
cy . findByText ( 'Toggle Input' ) . click ( ) ;
149
- cy . findByText ( 'Item 2' ) . should ( 'exist' ) ;
149
+ cy . findAllByText ( 'Item 2' ) . should ( 'exist' ) ;
150
150
cy . findByTestId ( '2' ) . should ( 'be.visible' ) . as ( 'item2' ) ;
151
151
cy . get ( '@item2' ) . parent ( ) . should ( 'have.css' , 'grid-column-start' , '17' ) . and ( 'have.css' , 'grid-row-start' , '1' ) ;
152
152
0 commit comments