USEPA / cam-api-portal

Api for data collected to run programs designed to reduce air pollution from power plants
MIT License
5 stars 3 forks source link

Investigate aXe and create unit test to run in pipeline #27

Closed j-tafoya closed 2 years ago

j-tafoya commented 2 years ago

Add to Actions pipeline

https://www.adrianbolonio.com/en/accessibility-github-actions/

sgillEPA commented 2 years ago

Meeting with Jonathan to set up the unit test.

sgillEPA commented 2 years ago

https://github.com/nickcolley/jest-axe

sgillEPA commented 2 years ago

//Example unit test for accessibility using jest-axe above

$ npm install jest-axe --save-dev

import React from "react" import App from "./App" import { render } from "@testing-library/react" import { axe, toHaveNoViolations } from "jest-axe"

expect.extend(toHaveNoViolations)

it("should not have any accessibility violations", async () => { const { container } = render() const results = await axe(container) expect(results).toHaveNoViolations() })

sgillEPA commented 2 years ago

https://www.youtube.com/watch?v=jC_7NnRdYb0

sgillEPA commented 2 years ago

Unit test was successful