Skip to content

Commit eaf1e37

Browse files
committed
LoadingSpinner: Improve a11y
1 parent 12c0230 commit eaf1e37

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

app/components/loading-spinner.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div
2-
title="Loading Spinner"
32
local-class="spinner"
43
...attributes
54
>
5+
<span local-class="message">Loading…</span>
66
</div>

app/components/loading-spinner.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
}
2020
}
2121

22+
.message {
23+
composes: sr-only from '../styles/shared/a11y.module.css';
24+
}
25+
2226
@keyframes spinner {
2327
0% {
2428
transform: rotate(0deg);

tests/acceptance/crate-following-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module('Acceptance | Crate following', function (hooks) {
3737

3838
visit('/crates/nanomsg');
3939
await waitFor('[data-test-follow-button] [data-test-spinner]');
40-
assert.dom('[data-test-follow-button]').hasText('');
40+
assert.dom('[data-test-follow-button]').hasText('Loading…');
4141
assert.dom('[data-test-follow-button] [data-test-spinner]').exists();
4242

4343
followingDeferred.resolve({ following: false });
@@ -50,7 +50,7 @@ module('Acceptance | Crate following', function (hooks) {
5050

5151
click('[data-test-follow-button]');
5252
await waitFor('[data-test-follow-button] [data-test-spinner]');
53-
assert.dom('[data-test-follow-button]').hasText('');
53+
assert.dom('[data-test-follow-button]').hasText('Loading…');
5454
assert.dom('[data-test-follow-button] [data-test-spinner]').exists();
5555

5656
followDeferred.resolve({ ok: true });
@@ -63,7 +63,7 @@ module('Acceptance | Crate following', function (hooks) {
6363

6464
click('[data-test-follow-button]');
6565
await waitFor('[data-test-follow-button] [data-test-spinner]');
66-
assert.dom('[data-test-follow-button]').hasText('');
66+
assert.dom('[data-test-follow-button]').hasText('Loading…');
6767
assert.dom('[data-test-follow-button] [data-test-spinner]').exists();
6868

6969
unfollowDeferred.resolve({ ok: true });

0 commit comments

Comments
 (0)