1
1
import { module , test } from 'qunit' ;
2
2
import { setupRenderingTest } from 'ember-qunit' ;
3
3
import { render } from '@ember/test-helpers' ;
4
+ import type { TestContext } from '@ember/test-helpers' ;
4
5
import hbs from 'htmlbars-inline-precompile' ;
5
6
import { a11yAudit , setEnableA11yAudit } from 'ember-a11y-testing/test-support' ;
6
7
8
+ interface Context extends TestContext {
9
+ element : Element ;
10
+ }
11
+
7
12
module ( 'Integration | Helper | a11yAudit' , function ( hooks ) {
8
13
setupRenderingTest ( hooks ) ;
9
14
@@ -15,13 +20,13 @@ module('Integration | Helper | a11yAudit', function (hooks) {
15
20
setEnableA11yAudit ( false ) ;
16
21
} ) ;
17
22
18
- test ( 'a11yAudit runs successfully with element context' , async function ( assert ) {
23
+ test ( 'a11yAudit runs successfully with element context' , async function ( this : Context , assert ) {
19
24
await render ( hbs `<AxeComponent/>` ) ;
20
25
await a11yAudit ( this . element ) ;
21
26
assert . ok ( true , "a11yAudit ran and didn't find any issues" ) ;
22
27
} ) ;
23
28
24
- test ( 'a11yAudit catches violations successfully' , async function ( assert ) {
29
+ test ( 'a11yAudit catches violations successfully' , async function ( this : Context , assert ) {
25
30
await render (
26
31
hbs `<AxeComponent><button type="button"></button></AxeComponent>`
27
32
) ;
@@ -33,7 +38,7 @@ module('Integration | Helper | a11yAudit', function (hooks) {
33
38
) ;
34
39
} ) ;
35
40
36
- test ( 'a11yAudit can use custom axe options' , async function ( assert ) {
41
+ test ( 'a11yAudit can use custom axe options' , async function ( this : Context , assert ) {
37
42
await render (
38
43
hbs `<AxeComponent><button type="button"></button></AxeComponent>`
39
44
) ;
0 commit comments