@@ -79,6 +79,7 @@ const OverflowTestComponent = (props: PropTypes) => {
79
79
< Text data-testid = "toolbar-item" style = { { width : '200px' } } >
80
80
Item1
81
81
</ Text >
82
+ { /*not rendered in overflow popover*/ }
82
83
< ToolbarSpacer data-testid = "spacer1" />
83
84
< Text data-testid = "toolbar-item2" style = { { width : '200px' } } >
84
85
Item2
@@ -143,7 +144,7 @@ describe('Toolbar', () => {
143
144
cy . mount ( < OverflowTestComponent onOverflowChange = { onOverflowChange } /> ) ;
144
145
cy . get ( '@overflowChangeSpy' ) . should ( 'have.been.calledOnce' ) ;
145
146
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 2 ) ;
146
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 4 ) ;
147
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 3 ) ;
147
148
cy . findByText ( 'Item1' ) . should ( 'be.visible' ) ;
148
149
cy . get ( '[data-testid="toolbar-item2"]' ) . should ( 'not.be.visible' ) ;
149
150
cy . get ( '[data-testid="toolbar-item3"]' ) . should ( 'not.be.visible' ) ;
@@ -156,22 +157,22 @@ describe('Toolbar', () => {
156
157
157
158
cy . viewport ( 500 , 500 ) ;
158
159
159
- // fuzzy - remount component instead
160
+ // flaky - remount component instead
160
161
// cy.get(`[ui5-toggle-button]`).click();
161
162
cy . mount ( < OverflowTestComponent onOverflowChange = { onOverflowChange } /> ) ;
162
163
cy . get ( '[ui5-popover]' ) . should ( 'not.have.attr' , 'open' ) ;
163
164
164
165
cy . get ( '@overflowChangeSpy' ) . should ( 'have.callCount' , 2 ) ;
165
166
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 3 ) ;
166
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 3 ) ;
167
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 2 ) ;
167
168
168
169
cy . findByTestId ( 'input' ) . shadow ( ) . find ( 'input' ) . type ( '100' ) ;
169
170
cy . findByTestId ( 'input' ) . trigger ( 'change' ) ;
170
171
cy . findByTestId ( 'input' ) . shadow ( ) . find ( 'input' ) . clear ( { force : true } ) ;
171
172
172
173
cy . get ( '@overflowChangeSpy' ) . should ( 'have.callCount' , 3 ) ;
173
174
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 0 ) ;
174
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 6 ) ;
175
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 4 ) ;
175
176
176
177
cy . get ( '[data-testid="toolbar-item"]' ) . should ( 'not.be.visible' ) ;
177
178
cy . get ( '[data-testid="toolbar-item2"]' ) . should ( 'not.be.visible' ) ;
@@ -193,13 +194,13 @@ describe('Toolbar', () => {
193
194
194
195
cy . get ( '@overflowChangeSpy' ) . should ( 'have.callCount' , 5 ) ;
195
196
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 3 ) ;
196
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 3 ) ;
197
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 2 ) ;
197
198
198
199
cy . findByText ( 'Add' ) . click ( ) ;
199
200
200
201
cy . get ( '@overflowChangeSpy' ) . should ( 'have.callCount' , 6 ) ;
201
202
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 3 ) ;
202
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 4 ) ;
203
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 3 ) ;
203
204
204
205
cy . findByText ( 'Add' ) . click ( ) ;
205
206
cy . findByText ( 'Add' ) . click ( ) ;
@@ -209,13 +210,13 @@ describe('Toolbar', () => {
209
210
210
211
cy . get ( '@overflowChangeSpy' ) . should ( 'have.callCount' , 11 ) ;
211
212
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 3 ) ;
212
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 9 ) ;
213
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 8 ) ;
213
214
214
215
cy . findByText ( 'Remove' ) . click ( ) ;
215
216
216
217
cy . get ( '@overflowChangeSpy' ) . should ( 'have.callCount' , 12 ) ;
217
218
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 3 ) ;
218
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 8 ) ;
219
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 7 ) ;
219
220
220
221
cy . findByText ( 'Remove' ) . click ( ) ;
221
222
cy . findByText ( 'Remove' ) . click ( ) ;
@@ -225,14 +226,14 @@ describe('Toolbar', () => {
225
226
226
227
cy . get ( '@overflowChangeSpy' ) . should ( 'have.callCount' , 17 ) ;
227
228
cy . findByTestId ( 'toolbarElements' ) . should ( 'have.text' , 3 ) ;
228
- cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 3 ) ;
229
+ cy . findByTestId ( 'overflowElements' ) . should ( 'have.text' , 2 ) ;
229
230
230
231
cy . get ( `[ui5-toggle-button]` ) . click ( ) ;
231
232
232
- // ToolbarSpacers should not be visible in the popover
233
+ // ToolbarSpacers should not be rendered in the popover
233
234
cy . get ( '[data-component-name="ToolbarOverflowPopover"]' )
234
235
. findByTestId ( 'spacer2' )
235
- . should ( 'not.be.visible ' , { timeout : 100 } ) ;
236
+ . should ( 'not.exist ' , { timeout : 100 } ) ;
236
237
cy . findByTestId ( 'spacer1' ) . should ( 'exist' ) ;
237
238
238
239
// ToolbarSeparator should be displayed with horizontal line
0 commit comments