-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* get ActionBar axe clean * changeset * fix type * fix type
- Loading branch information
Showing
3 changed files
with
44 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/react': patch | ||
--- | ||
|
||
ActionBar now produces valid HTML |
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,35 @@ | ||
import React from 'react' | ||
import {behavesAsComponent} from '../../utils/testing' | ||
import {render as HTMLRender} from '@testing-library/react' | ||
import {axe} from 'jest-axe' | ||
|
||
import ActionBar from './' | ||
import {BoldIcon, CodeIcon, ItalicIcon, LinkIcon} from '@primer/octicons-react' | ||
|
||
const SimpleActionBar = () => ( | ||
<ActionBar> | ||
<ActionBar.IconButton icon={BoldIcon} aria-label="Default"></ActionBar.IconButton> | ||
<ActionBar.IconButton icon={ItalicIcon} aria-label="Default"></ActionBar.IconButton> | ||
<ActionBar.Divider /> | ||
<ActionBar.IconButton icon={CodeIcon} aria-label="Default"></ActionBar.IconButton> | ||
<ActionBar.IconButton icon={LinkIcon} aria-label="Default"></ActionBar.IconButton> | ||
</ActionBar> | ||
) | ||
|
||
describe('ActionBar', () => { | ||
afterEach(() => { | ||
jest.clearAllMocks() | ||
}) | ||
|
||
behavesAsComponent({ | ||
Component: ActionBar, | ||
options: {skipAs: true, skipSx: true}, | ||
toRender: () => <SimpleActionBar />, | ||
}) | ||
|
||
it('should have no axe violations', async () => { | ||
const {container} = HTMLRender(<SimpleActionBar />) | ||
const results = await axe(container) | ||
expect(results).toHaveNoViolations() | ||
}) | ||
}) |
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