Skip to content

Commit 1fbad60

Browse files
committed
Feat: Add a11y audit tests to Pagination
1 parent 9ddee5e commit 1fbad60

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

showcase/app/styles/showcase-pages/pagination.scss

-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ body.components-pagination {
2020
}
2121
}
2222

23-
.shw-component-pagination-ul-wrapper {
24-
margin: 0;
25-
padding: 0;
26-
list-style: none;
27-
}
28-
2923
// paginated tables demo
3024

3125
.shw-component-pagination-table-demo {

showcase/app/templates/components/pagination.hbs

+11-14
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,11 @@
227227
<Shw::Flex as |SF|>
228228
<SF.Item as |SFI|>
229229
<SFI.Label>Generic (default)</SFI.Label>
230-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number @page="1" /></ul>
230+
<Hds::Pagination::Nav::Number @page="1" />
231231
</SF.Item>
232232
<SF.Item as |SFI|>
233233
<SFI.Label>Current (with <code>@isSelected=&lcub;&lcub;true&rcub;&rcub;</code>)</SFI.Label>
234-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number
235-
@page="1"
236-
@isSelected={{true}}
237-
/></ul>
234+
<Hds::Pagination::Nav::Number @page="1" @isSelected={{true}} />
238235
</SF.Item>
239236
</Shw::Flex>
240237

@@ -247,31 +244,31 @@
247244
<SF.Item @label={{capitalize state}} mock-state-value={{state}} mock-state-selector="button,a">
248245
<Shw::Flex as |SF|>
249246
<SF.Item>
250-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number @page="1" /></ul>
247+
<Hds::Pagination::Nav::Number @page="1" />
251248
</SF.Item>
252249
<SF.Item>
253-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number @page="12" /></ul>
250+
<Hds::Pagination::Nav::Number @page="12" />
254251
</SF.Item>
255252
<SF.Item>
256-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number @page="123" /></ul>
253+
<Hds::Pagination::Nav::Number @page="123" />
257254
</SF.Item>
258255
<SF.Item>
259-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number
256+
<Hds::Pagination::Nav::Number
260257
@page="1"
261258
@isSelected={{true}}
262-
/></ul>
259+
/>
263260
</SF.Item>
264261
<SF.Item>
265-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number
262+
<Hds::Pagination::Nav::Number
266263
@page="12"
267264
@isSelected={{true}}
268-
/></ul>
265+
/>
269266
</SF.Item>
270267
<SF.Item>
271-
<ul class="shw-component-pagination-ul-wrapper"><Hds::Pagination::Nav::Number
268+
<Hds::Pagination::Nav::Number
272269
@page="123"
273270
@isSelected={{true}}
274-
/></ul>
271+
/>
275272
</SF.Item>
276273
</Shw::Flex>
277274
</SF.Item>

showcase/tests/acceptance/components/hds/pagination-test.js

+15
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,25 @@
66
import { module, test } from 'qunit';
77
import { click, select, visit, currentURL } from '@ember/test-helpers';
88
import { setupApplicationTest } from '../../../helpers';
9+
import { a11yAudit } from 'ember-a11y-testing/test-support';
910

1011
module('Acceptance | Component | hds/pagination', function (hooks) {
1112
setupApplicationTest(hooks);
1213

14+
test('Components/pagination page passes automated a11y checks', async function (assert) {
15+
let axeOptions = {
16+
rules: {
17+
'landmark-unique': {
18+
enabled: false,
19+
},
20+
},
21+
};
22+
await visit('/components/pagination');
23+
await a11yAudit(axeOptions);
24+
25+
assert.ok(true, 'a11y automation audit passed');
26+
})
27+
1328
test('interacting with the demo of a "numbered" pagination with routing', async function (assert) {
1429
await visit('/components/pagination');
1530

0 commit comments

Comments
 (0)