Skip to content

Commit b6e5f99

Browse files
committed
chore: update tests
1 parent c3d6a48 commit b6e5f99

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

packages/button/test/button.test.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -395,32 +395,23 @@ describe('Button', () => {
395395

396396
it('manages aria-label from pending state', async () => {
397397
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">
404399
Click me
405400
</sp-button>
406401
`);
407402
await elementUpdated(el);
408-
expect(el.getAttribute('aria-label')).to.equal('Pending');
403+
expect(el.getAttribute('aria-label')).to.equal('clickable');
409404

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;
412407
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');
414410

415411
// pending is removed and the aria-label should not change as the button is disabled
416412
el.pending = false;
417413
await elementUpdated(el);
418414
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');
424415
});
425416

426417
it('updates aria-label when label changes', async () => {

tools/reactive-controllers/test/pending-state.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('PendingStateController', () => {
8383
id="loader"
8484
size="s"
8585
indeterminate
86-
aria-valuetext=${pendingLabel}
86+
aria-label=${pendingLabel}
8787
class="progress-circle"
8888
></sp-progress-circle>
8989
`);
@@ -103,7 +103,7 @@ describe('PendingStateController', () => {
103103
id="loader"
104104
size="s"
105105
indeterminate
106-
aria-valuetext="Pending"
106+
aria-label="Pending"
107107
class="progress-circle"
108108
></sp-progress-circle>
109109
`);
@@ -147,7 +147,7 @@ describe('PendingStateController', () => {
147147
id="loader"
148148
size="s"
149149
indeterminate
150-
aria-valuetext="Pending"
150+
aria-label="Pending"
151151
class="progress-circle"
152152
></sp-progress-circle>
153153
`);

0 commit comments

Comments
 (0)