@@ -12,7 +12,7 @@ import Button from "../../src/Button.js";
12
12
import Dialog from "../../src/Dialog.js" ;
13
13
14
14
describe ( "Toolbar general interaction" , ( ) => {
15
- it . skip ( "Should not return null upon calling getDomRef for all direct child items" , ( ) => {
15
+ it ( "Should not return null upon calling getDomRef for all direct child items" , ( ) => {
16
16
cy . mount (
17
17
< Toolbar id = "otb_standard" >
18
18
< ToolbarButton text = "Button 1" > </ ToolbarButton >
@@ -143,7 +143,7 @@ describe("Toolbar general interaction", () => {
143
143
button . get ( 0 ) . addEventListener ( "click" , cy . stub ( ) . as ( "clicked" ) ) ;
144
144
} ) ;
145
145
146
- cy . get ( "ui5-button" , { includeShadowDom : true } ) . contains ( "Button 1" )
146
+ cy . get ( "ui5-button" , { includeShadowDom : true } ) . contains ( "Button 1" )
147
147
. click ( ) ;
148
148
149
149
cy . get ( "@clicked" )
@@ -312,6 +312,56 @@ describe("Accessibility", () => {
312
312
} ) ;
313
313
} ) ;
314
314
315
+ describe ( "Toolbar in Dialog" , ( ) => {
316
+ it ( "Should correctly process overflow layout when rendered inside a dialog" , ( ) => {
317
+ cy . viewport ( 400 , 600 ) ;
318
+
319
+ cy . mount (
320
+ < div >
321
+ < Button id = "open-dialog-button" onClick = { ( ) => {
322
+ const dialog = document . getElementById ( "dialog" ) as Dialog ;
323
+ dialog . open = true ;
324
+ } } > Open Dialog</ Button >
325
+
326
+ < Dialog id = "dialog" >
327
+ < Toolbar id = "toolbar-in-dialog" >
328
+ < ToolbarButton icon = { add } text = "Plus" design = "Default" > </ ToolbarButton >
329
+ < ToolbarButton icon = { employee } text = "Hire" > </ ToolbarButton >
330
+ < ToolbarSeparator > </ ToolbarSeparator >
331
+ < ToolbarButton icon = { add } text = "Add" > </ ToolbarButton >
332
+ < ToolbarButton icon = { decline } text = "Decline" > </ ToolbarButton >
333
+ < ToolbarSpacer > </ ToolbarSpacer >
334
+ < ToolbarButton icon = { add } text = "Append" > </ ToolbarButton >
335
+ < ToolbarButton icon = { employee } text = "More" > </ ToolbarButton >
336
+ < ToolbarButton icon = { decline } text = "Extra" > </ ToolbarButton >
337
+ < ToolbarButton icon = { add } text = "Final" > </ ToolbarButton >
338
+ < ToolbarButton icon = { employee } text = "Last" > </ ToolbarButton >
339
+ < ToolbarButton icon = { decline } text = "Final" > </ ToolbarButton >
340
+ < ToolbarButton icon = { add } text = "Plus" > </ ToolbarButton >
341
+ </ Toolbar >
342
+ </ Dialog >
343
+ </ div >
344
+ ) ;
345
+
346
+ // Open dialog
347
+ cy . get ( "#open-dialog-button" ) . click ( ) ;
348
+ cy . get < Dialog > ( "#dialog" ) . ui5DialogOpened ( ) ;
349
+
350
+ // Verify toolbar is rendered inside the dialog
351
+ cy . get ( "#toolbar-in-dialog" )
352
+ . should ( "exist" )
353
+ . should ( "be.visible" ) ;
354
+
355
+ // Check that overflow processing has occurred by verifying overflow button exists and is visible
356
+ // Since we have many items in a constrained width, some should overflow
357
+ cy . get ( "#toolbar-in-dialog" )
358
+ . shadow ( )
359
+ . find ( ".ui5-tb-overflow-btn" )
360
+ . should ( "exist" )
361
+ . should ( "not.have.class" , "ui5-tb-overflow-btn-hidden" ) ;
362
+ } ) ;
363
+ } ) ;
364
+
315
365
//ToolbarSelect
316
366
describe ( "Toolbar Select" , ( ) => {
317
367
it ( "Should render the select with the correct attributes inside the popover" , ( ) => {
@@ -350,21 +400,21 @@ describe("Toolbar Select", () => {
350
400
cy . wait ( 500 ) ;
351
401
352
402
cy . get ( "@otb" )
353
- . find ( "#toolbar-select" )
403
+ . find ( "#toolbar-select" )
354
404
. should ( "have.attr" , "value-state" , "Critical" )
355
405
356
406
. should ( "have.attr" , "accessible-name" , "Add" )
357
407
358
408
. should ( "have.attr" , "accessible-name-ref" , "title" )
359
409
360
410
cy . get ( "@otb" )
361
- . find ( ".custom-class" )
362
- . should ( "have.attr" , "disabled" , "disabled" ) ;
411
+ . find ( ".custom-class" )
412
+ . should ( "have.attr" , "disabled" , "disabled" ) ;
363
413
364
414
} ) ;
365
415
366
416
//ToolbarButton
367
- it ( "Should render the button with the correct text inside the popover" , async ( ) => {
417
+ it . skip ( "Should render the button with the correct text inside the popover" , async ( ) => {
368
418
cy . viewport ( 200 , 1080 ) ;
369
419
370
420
cy . get ( "#otb_d" ) . within ( ( ) => {
@@ -384,7 +434,7 @@ describe("Toolbar Select", () => {
384
434
} ) ;
385
435
} ) ;
386
436
387
- it ( "Should render the button with the correct accessible name inside the popover" , async ( ) => {
437
+ it . skip ( "Should render the button with the correct accessible name inside the popover" , async ( ) => {
388
438
cy . viewport ( 100 , 1080 ) ;
389
439
390
440
cy . get ( "#otb_d" ) . within ( ( ) => {
@@ -398,7 +448,7 @@ describe("Toolbar Select", () => {
398
448
} ) ;
399
449
} ) ;
400
450
401
- it ( "Should render the button with the correct accessibilityAttributes inside the popover" , async ( ) => {
451
+ it . skip ( "Should render the button with the correct accessibilityAttributes inside the popover" , async ( ) => {
402
452
cy . viewport ( 100 , 1080 ) ;
403
453
404
454
cy . get ( "#otb_d" ) . within ( ( ) => {
@@ -408,54 +458,4 @@ describe("Toolbar Select", () => {
408
458
} ) ;
409
459
} ) ;
410
460
} ) ;
411
-
412
- describe ( "Toolbar in Dialog" , ( ) => {
413
- it ( "Should correctly process overflow layout when rendered inside a dialog" , ( ) => {
414
- cy . viewport ( 400 , 600 ) ;
415
-
416
- cy . mount (
417
- < div >
418
- < Button id = "open-dialog-button" onClick = { ( ) => {
419
- const dialog = document . getElementById ( "dialog" ) as Dialog ;
420
- dialog . open = true ;
421
- } } > Open Dialog</ Button >
422
-
423
- < Dialog id = "dialog" >
424
- < Toolbar id = "toolbar-in-dialog" >
425
- < ToolbarButton icon = { add } text = "Plus" design = "Default" > </ ToolbarButton >
426
- < ToolbarButton icon = { employee } text = "Hire" > </ ToolbarButton >
427
- < ToolbarSeparator > </ ToolbarSeparator >
428
- < ToolbarButton icon = { add } text = "Add" > </ ToolbarButton >
429
- < ToolbarButton icon = { decline } text = "Decline" > </ ToolbarButton >
430
- < ToolbarSpacer > </ ToolbarSpacer >
431
- < ToolbarButton icon = { add } text = "Append" > </ ToolbarButton >
432
- < ToolbarButton icon = { employee } text = "More" > </ ToolbarButton >
433
- < ToolbarButton icon = { decline } text = "Extra" > </ ToolbarButton >
434
- < ToolbarButton icon = { add } text = "Final" > </ ToolbarButton >
435
- < ToolbarButton icon = { employee } text = "Last" > </ ToolbarButton >
436
- < ToolbarButton icon = { decline } text = "Final" > </ ToolbarButton >
437
- < ToolbarButton icon = { add } text = "Plus" > </ ToolbarButton >
438
- </ Toolbar >
439
- </ Dialog >
440
- </ div >
441
- ) ;
442
-
443
- // Open dialog
444
- cy . get ( "#open-dialog-button" ) . click ( ) ;
445
- cy . get < Dialog > ( "#dialog" ) . ui5DialogOpened ( ) ;
446
-
447
- // Verify toolbar is rendered inside the dialog
448
- cy . get ( "#toolbar-in-dialog" )
449
- . should ( "exist" )
450
- . should ( "be.visible" ) ;
451
-
452
- // Check that overflow processing has occurred by verifying overflow button exists and is visible
453
- // Since we have many items in a constrained width, some should overflow
454
- cy . get ( "#toolbar-in-dialog" )
455
- . shadow ( )
456
- . find ( ".ui5-tb-overflow-btn" )
457
- . should ( "exist" )
458
- . should ( "not.have.class" , "ui5-tb-overflow-btn-hidden" ) ;
459
- } ) ;
460
- } ) ;
461
461
} ) ;
0 commit comments