File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed
tools/reactive-controllers/test Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -395,32 +395,23 @@ describe('Button', () => {
395
395
396
396
it ( 'manages aria-label from pending state' , async ( ) => {
397
397
const el = await fixture < Button > ( html `
398
- < sp-button
399
- href ="test_url "
400
- target ="_blank "
401
- label ="clickable "
402
- pending
403
- >
398
+ < sp-button href ="test_url " target ="_blank " label ="clickable ">
404
399
Click me
405
400
</ sp-button >
406
401
` ) ;
407
402
await elementUpdated ( el ) ;
408
- expect ( el . getAttribute ( 'aria-label' ) ) . to . equal ( 'Pending ' ) ;
403
+ expect ( el . getAttribute ( 'aria-label' ) ) . to . equal ( 'clickable ' ) ;
409
404
410
- // button set to disabled while pending is true and the aria-label should be original
411
- el . disabled = true ;
405
+ // button set to pending and aria-label should update
406
+ el . pending = true ;
412
407
await elementUpdated ( el ) ;
413
- expect ( el . getAttribute ( 'aria-label' ) ) . to . equal ( 'clickable' ) ;
408
+ expect ( el . pending ) . to . be . true ;
409
+ expect ( el . getAttribute ( 'aria-label' ) ) . to . equal ( 'Pending' ) ;
414
410
415
411
// pending is removed and the aria-label should not change as the button is disabled
416
412
el . pending = false ;
417
413
await elementUpdated ( el ) ;
418
414
expect ( el . getAttribute ( 'aria-label' ) ) . to . equal ( 'clickable' ) ;
419
-
420
- // button is enabled and the aria-label should not change
421
- el . disabled = false ;
422
- await elementUpdated ( el ) ;
423
- expect ( el . getAttribute ( 'aria-label' ) ) . to . equal ( 'clickable' ) ;
424
415
} ) ;
425
416
426
417
it ( 'updates aria-label when label changes' , async ( ) => {
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ describe('PendingStateController', () => {
83
83
id ="loader "
84
84
size ="s "
85
85
indeterminate
86
- aria-valuetext =${ pendingLabel }
86
+ aria-label =${ pendingLabel }
87
87
class ="progress-circle"
88
88
> </ sp-progress-circle >
89
89
` ) ;
@@ -103,7 +103,7 @@ describe('PendingStateController', () => {
103
103
id ="loader "
104
104
size ="s "
105
105
indeterminate
106
- aria-valuetext ="Pending "
106
+ aria-label ="Pending "
107
107
class ="progress-circle "
108
108
> </ sp-progress-circle >
109
109
` ) ;
@@ -147,7 +147,7 @@ describe('PendingStateController', () => {
147
147
id ="loader "
148
148
size ="s "
149
149
indeterminate
150
- aria-valuetext ="Pending "
150
+ aria-label ="Pending "
151
151
class ="progress-circle "
152
152
> </ sp-progress-circle >
153
153
` ) ;
You can’t perform that action at this time.
0 commit comments