-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Semantic HTML Audit #32
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| @use '../../styles/colors' as *; | ||
| @use '../../styles/spacing' as *; | ||
| @use '../../styles/fonts' as *; | ||
| @use '../../styles/mixins' as *; | ||
|
|
||
| .status-label { | ||
| @include visually-hidden(); | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just making a note: Let's be sure to coordinate this merge with #31 since it includes the extracted mixin |
||
|
|
||
| .employee-status { | ||
| width: 0.75rem; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,12 +9,17 @@ import Link from './link'; | |
|
|
||
| describe('the Link component', () => { | ||
| it('renders a link with the correct href given an href prop', () => { | ||
| render(<Link href="http://some/url">hello!</Link>); | ||
| render(<Link href="http://some/url" ariaLabel="test link">hello</Link>); | ||
| expect(screen.getByRole('link')).toHaveAttribute('href', 'http://some/url'); | ||
| }); | ||
|
|
||
| it('renders a link given an href and text', () => { | ||
| render(<Link href="http://some/url">hello!</Link>); | ||
| it('renders a link with the correct aria-label given an ariaLabel prop', () => { | ||
| render(<Link href="http://some/url" ariaLabel="test link">hello</Link>); | ||
| expect(screen.getByRole('link')).toHaveAttribute('aria-label', 'test link'); | ||
| }); | ||
|
|
||
| it('renders a link with the correct inner text', () => { | ||
| render(<Link href="http://some/url" ariaLabel="test link">hello</Link>); | ||
| expect(screen.getByRole('link')).toHaveTextContent('hello'); | ||
| }); | ||
| }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to test the new label? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,12 +16,13 @@ const makePreviousApprentice = (apprentice) => ( | |
|
|
||
| const PreviousApprenticesGroup = ({ version, apprentices }) => ( | ||
| <section className={styles['previous-apprentices-group']}> | ||
| <p | ||
| <h3 | ||
| className={styles['previous-apprentices-group__version']} | ||
| aria-label={`Previous apprentices group version ${version}`} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love this. |
||
| data-testid={version} | ||
| > | ||
| {version} | ||
| </p> | ||
| </h3> | ||
| <ul className={styles['previous-apprentices-group__statuses']}> | ||
| {apprentices.map(makePreviousApprentice)} | ||
| </ul> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,9 +24,8 @@ const Home = ({ apprenticeData: { currentApprenticeGroup, previousApprenticeGrou | |
| <title>Sparkbox Apprentices</title> | ||
| <link rel="icon" href="/favicon.ico" /> | ||
| </Head> | ||
|
|
||
| <Hero /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, easy fix |
||
| <main> | ||
| <Hero /> | ||
| <ApprenticeQualities /> | ||
| <CurrentApprentices currentApprenticeClass={currentApprenticeGroup} /> | ||
| <PreviousApprentices previousApprenticeGroups={previousApprenticeGroups} /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍