File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/cdk-experimental/radio Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ const colors = {
18
18
} ;
19
19
20
20
// TODO: Move this to a separate folder/file so it can be reused across components.
21
- async function getAccessibilityViolationsReport ( root : HTMLElement ) : Promise < string | null > {
21
+ async function runAccessibilityChecks ( root : HTMLElement ) : Promise < void > {
22
22
const results = await axe . run ( root ) ;
23
23
24
24
if ( ! results . violations . length ) {
25
- return null ;
25
+ return ;
26
26
}
27
27
28
28
const reportLines : string [ ] = [ ] ;
@@ -74,7 +74,7 @@ async function getAccessibilityViolationsReport(root: HTMLElement): Promise<stri
74
74
}
75
75
} ) ;
76
76
77
- return reportLines . join ( '\n' ) ;
77
+ fail ( reportLines . join ( '\n' ) ) ;
78
78
}
79
79
80
80
describe ( 'CdkRadioGroup' , ( ) => {
@@ -178,11 +178,7 @@ describe('CdkRadioGroup', () => {
178
178
}
179
179
180
180
afterEach ( async ( ) => {
181
- const report = await getAccessibilityViolationsReport ( radioGroupElement ) ;
182
-
183
- if ( report ) {
184
- fail ( report ) ;
185
- }
181
+ await runAccessibilityChecks ( radioGroupElement ) ;
186
182
} ) ;
187
183
188
184
describe ( 'ARIA attributes and roles' , ( ) => {
You can’t perform that action at this time.
0 commit comments