-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8a9914
commit 322755e
Showing
11 changed files
with
153 additions
and
210 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
2 changes: 1 addition & 1 deletion
2
packages/design-system/src/components/ButtonIcon/ButtonIcon.test.tsx
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
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,26 @@ | ||
import { expect } from '@jest/globals'; | ||
import { axe } from 'jest-axe'; | ||
import { render } from '@testing-library/react'; | ||
import { Tabs, TabPanel, Tab, TabsProvider } from './'; | ||
|
||
describe('ButtonIcon', () => { | ||
it('should render accessible button', async () => { | ||
// note we need to add the aria-label to be accessible | ||
// TODO: make it required | ||
const { container } = render( | ||
<TabsProvider defaultActiveKey="profile"> | ||
<Tabs> | ||
<Tab aria-controls="home" title="Home" /> | ||
<Tab aria-controls="profile" title="Profile" /> | ||
<Tab aria-controls="contact" title="Contact" disabled /> | ||
</Tabs> | ||
<TabPanel id="home">Tab content for Home</TabPanel> | ||
<TabPanel id="profile">Tab content for Profile</TabPanel> | ||
<TabPanel id="contact">Tab content for Contact</TabPanel> | ||
</TabsProvider>, | ||
); | ||
expect(container.firstChild).toMatchSnapshot(); | ||
const results = await axe(document.body); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
}); |
87 changes: 87 additions & 0 deletions
87
packages/design-system/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap
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,87 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ButtonIcon should render accessible button 1`] = ` | ||
<nav> | ||
<div | ||
class="theme-stack theme-justify-start theme-align-start theme-nowrap theme-column theme-block theme-gap-x-M theme-gap-y-M" | ||
> | ||
<div | ||
class="theme-stack theme-justify-start theme-align-start theme-nowrap theme-row theme-block theme-gap-x-M theme-gap-y-M" | ||
role="tablist" | ||
> | ||
<button | ||
aria-selected="false" | ||
class="theme-tab" | ||
role="tab" | ||
type="button" | ||
> | ||
<div | ||
class="theme-stack theme-justify-start theme-align-center theme-nowrap theme-row theme-inline theme-gap-x-XXS theme-gap-y-XXS" | ||
> | ||
<span | ||
class="theme-tab__copy" | ||
> | ||
Home | ||
</span> | ||
</div> | ||
</button> | ||
<button | ||
aria-selected="true" | ||
class="theme-tab" | ||
role="tab" | ||
type="button" | ||
> | ||
<div | ||
class="theme-stack theme-justify-start theme-align-center theme-nowrap theme-row theme-inline theme-gap-x-XXS theme-gap-y-XXS" | ||
> | ||
<span | ||
class="theme-tab__copy" | ||
> | ||
Profile | ||
</span> | ||
</div> | ||
</button> | ||
<button | ||
aria-selected="false" | ||
class="theme-tab" | ||
disabled="" | ||
role="tab" | ||
type="button" | ||
> | ||
<div | ||
class="theme-stack theme-justify-start theme-align-center theme-nowrap theme-row theme-inline theme-gap-x-XXS theme-gap-y-XXS" | ||
> | ||
<span | ||
class="theme-tab__copy" | ||
> | ||
Contact | ||
</span> | ||
</div> | ||
</button> | ||
</div> | ||
<div | ||
id="home" | ||
role="tabpanel" | ||
style="display: none;" | ||
tabindex="0" | ||
> | ||
Tab content for Home | ||
</div> | ||
<div | ||
id="profile" | ||
role="tabpanel" | ||
tabindex="0" | ||
> | ||
Tab content for Profile | ||
</div> | ||
<div | ||
id="contact" | ||
role="tabpanel" | ||
style="display: none;" | ||
tabindex="0" | ||
> | ||
Tab content for Contact | ||
</div> | ||
</div> | ||
</nav> | ||
`; |
70 changes: 0 additions & 70 deletions
70
packages/design-system/src/components/Tabs/variants/Tabs.tsx
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
packages/design-system/src/components/Tabs/variants/TabsAsLinkList.module.scss
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
packages/design-system/src/components/Tabs/variants/TabsAsLinkList.tsx
This file was deleted.
Oops, something went wrong.
75 changes: 0 additions & 75 deletions
75
packages/design-system/src/components/Tabs/variants/TabsKit.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.