-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2038 from adevinta/refacto-a11yscript-to-export
refactor: refacto a11y check to prepare JSON export
- Loading branch information
Showing
6 changed files
with
450 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
name: quality | ||
env: | ||
FORCE_COLOR: 3 | ||
on: | ||
pull_request: | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useEffect } from 'react' | ||
|
||
interface A11yReportProps { | ||
of: string | ||
} | ||
|
||
/** | ||
* For now we only will display accessibility report | ||
* in browser console. | ||
* This component may evolve and display data in a more visible way. | ||
*/ | ||
export const A11yReport = ({ of }: A11yReportProps) => { | ||
useEffect(() => { | ||
const fetchReport = async (name: string) => { | ||
const report = await fetch('/a11y-report.json') | ||
.then(response => response.json()) | ||
.catch(() => console.error('Unable to find accessibility report')) | ||
|
||
console.log(`${name} accessibility report:`, report[name]) | ||
} | ||
|
||
fetchReport(of) | ||
}, [of]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.