@@ -40,9 +40,7 @@ describe('vaadin-dialog', () => {
4040 let dialog , backdrop , overlay ;
4141
4242 beforeEach ( async ( ) => {
43- dialog = fixtureSync ( `
44- <vaadin-dialog opened theme="foo"></vaadin-dialog>
45- ` ) ;
43+ dialog = fixtureSync ( '<vaadin-dialog opened></vaadin-dialog>' ) ;
4644 await nextRender ( ) ;
4745
4846 dialog . renderer = ( root ) => {
@@ -59,48 +57,33 @@ describe('vaadin-dialog', () => {
5957 await nextRender ( ) ;
6058 } ) ;
6159
62- describe ( 'attributes' , ( ) => {
63- it ( 'overlay should have the `dialog` role' , ( ) => {
64- expect ( overlay . getAttribute ( 'role' ) ) . to . be . eql ( 'dialog' ) ;
65- } ) ;
66-
67- it ( 'overlay should have the `aria-label` attribute (if set)' , async ( ) => {
60+ describe ( 'aria-label' , ( ) => {
61+ beforeEach ( async ( ) => {
6862 dialog . ariaLabel = 'accessible' ;
6963 await nextUpdate ( dialog ) ;
70- expect ( overlay . getAttribute ( 'aria-label' ) ) . to . be . eql ( 'accessible' ) ;
7164 } ) ;
7265
73- it ( 'overlay should not have the `aria-label` attribute (if not set) ' , ( ) => {
74- expect ( overlay . getAttribute ( 'aria-label' ) ) . to . be . null ;
66+ it ( 'should set `aria-label` attribute on the overlay when ariaLabel is set' , ( ) => {
67+ expect ( overlay . getAttribute ( 'aria-label' ) ) . to . be . eql ( 'accessible' ) ;
7568 } ) ;
7669
77- it ( 'overlay should not have `aria-label` attribute if set to undefined' , async ( ) => {
78- dialog . ariaLabel = 'accessible' ;
79- await nextUpdate ( dialog ) ;
70+ it ( 'should remove `aria-label` attribute from the overlay when set to undefined' , async ( ) => {
8071 dialog . ariaLabel = undefined ;
8172 await nextUpdate ( dialog ) ;
8273 expect ( overlay . getAttribute ( 'aria-label' ) ) . to . be . null ;
8374 } ) ;
8475
85- it ( 'overlay should not have `aria-label` attribute if set to null' , async ( ) => {
86- dialog . ariaLabel = 'accessible' ;
87- await nextUpdate ( dialog ) ;
76+ it ( 'should remove `aria-label` attribute from the overlay when set to null' , async ( ) => {
8877 dialog . ariaLabel = null ;
8978 await nextUpdate ( dialog ) ;
9079 expect ( overlay . getAttribute ( 'aria-label' ) ) . to . be . null ;
9180 } ) ;
9281
93- it ( 'overlay should not have `aria-label` attribute if set to empty string' , async ( ) => {
94- dialog . ariaLabel = 'accessible' ;
95- await nextUpdate ( dialog ) ;
82+ it ( 'should remove `aria-label` attribute from the overlay when set to empty string' , async ( ) => {
9683 dialog . ariaLabel = '' ;
9784 await nextUpdate ( dialog ) ;
9885 expect ( overlay . getAttribute ( 'aria-label' ) ) . to . be . null ;
9986 } ) ;
100-
101- it ( 'should propagate theme attribute to the overlay' , ( ) => {
102- expect ( overlay . getAttribute ( 'theme' ) ) . to . be . eql ( dialog . getAttribute ( 'theme' ) ) ;
103- } ) ;
10487 } ) ;
10588
10689 describe ( 'no-close-on-esc' , ( ) => {
0 commit comments