Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Bring accessibility up to 100% in Lighthouse check #606

Merged
merged 15 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/lighthouse-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build project and run Lighthouse CI
on: [push]
jobs:
lighthouse_ci:
name: Lighthouse CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: npm ci
run: |
npm ci
npm run build
- name: Install chrome
run: |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get update
sudo apt-get install -y ./google-chrome-stable_current_amd64.deb
zoobot marked this conversation as resolved.
Show resolved Hide resolved
- name: Run Lighthouse CI
run: |
npm install -g @lhci/[email protected]
lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
1 change: 1 addition & 0 deletions client/src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const Header = () => {
}}
color="success"
className="header__btn-menu"
title="Menu"
>
<MenuRoundedIcon
sx={{ fontSize: '2.5rem', color: 'black' }}
Expand Down
2 changes: 1 addition & 1 deletion client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta name="viewport" content="initial-scale=1.0">
<meta name="description" content="WATER THE TREES">
<meta name="author" content="Code for San Francisco">
<meta name="theme-color" content="#ffffff">
Expand Down
1 change: 1 addition & 0 deletions client/src/pages/NewTree/NewTreeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default function NewTreeButton({ map }) {
value="Plant"
selected={isPlanting}
onChange={handlePlantClick}
title="Plant New Tree"
/>
{map && <NewTreePlantingMarker map={map} onPlantClick={openPanel} />}
</>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/UserLocation/GeolocateControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function GeolocateControl({ map }) {

return (
<>
<IconButton onClick={handleClick} style={{ color: '#333' }}>
<IconButton title="Find Your Location" onClick={handleClick} style={{ color: '#333' }}>
<GeolocateIcon
isTracking={isTracking}
isFollowingUser={isFollowingUser}
Expand Down
2 changes: 2 additions & 0 deletions client/src/tests/__snapshots__/Header.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ exports[`<Header /> spec renders Header correctly 1`] = `
<button
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorSuccess MuiIconButton-sizeSmall header__btn-menu emotion-0"
tabindex="0"
title="Menu"
type="button"
>
<svg
Expand Down Expand Up @@ -687,6 +688,7 @@ exports[`<Header /> spec renders Header correctly 1`] = `
<button
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-colorSuccess MuiIconButton-sizeSmall header__btn-menu emotion-0"
tabindex="0"
title="Menu"
type="button"
>
<svg
Expand Down
21 changes: 21 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
ci: {
collect: {
startServerCommand: 'npm run start:dev',
url: ['http://localhost:3001'],
zoobot marked this conversation as resolved.
Show resolved Hide resolved
disableDevShmUsage: true,
settings: {
'chromeFlags': '--no-sandbox --headless --disable-gpu',
},
},
assert: {
assertions: {
'categories:accessibility': ['error', { minScore: 1 }],
'categories:best-practices': ['error', { minScore: 1 }],
},
},
upload: {
target: 'temporary-public-storage',
},
},
};
2 changes: 1 addition & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ app.get('/*', (req, res) => {
});

const httpServer = http.createServer(app);
httpServer.listen(port, () => logger.info(`${host}:${port}`));
httpServer.listen(port, () => logger.info(`listening on ${host}:${port}`));