-
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
2437d0f
commit b714c9e
Showing
16 changed files
with
491 additions
and
39 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/design-system/src/components/ButtonAsLink/Primitive/ButtonPrimitiveAsLink.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
2 changes: 1 addition & 1 deletion
2
packages/design-system/src/components/Dropdown/Primitive/DropdownLink.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
24 changes: 24 additions & 0 deletions
24
packages/design-system/src/components/InlineMessage/InlineMessage.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { describe, it, expect } from '@jest/globals'; | ||
import { axe } from 'jest-axe'; | ||
import { render } from '@testing-library/react'; | ||
import { InlineMessage } from './'; | ||
|
||
describe('InlineMessage', () => { | ||
it('should render a11y html', async () => { | ||
const { container } = render( | ||
<main> | ||
<InlineMessage variant="information" description="The information message value" /> | ||
<InlineMessage variant="destructive" description="The destructive message value" /> | ||
<InlineMessage variant="success" description="The success message value" /> | ||
<InlineMessage variant="warning" description="The warning message value" /> | ||
<InlineMessage variant="beta" description="The beta message value" /> | ||
</main>, | ||
); | ||
// eslint-disable-next-line testing-library/no-container | ||
container.querySelector('button')?.click(); | ||
expect(container.firstChild).toMatchSnapshot(); | ||
const results = await axe(document.body); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
}); |
141 changes: 141 additions & 0 deletions
141
...ages/design-system/src/components/InlineMessage/__snapshots__/InlineMessage.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,141 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`InlineMessage should render a11y html 1`] = ` | ||
<main> | ||
<div | ||
aria-live="polite" | ||
class="theme-inlineMessage" | ||
role="status" | ||
> | ||
<span | ||
class="theme-icon theme-information__icon" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
pointer-events="none" | ||
shape-rendering="geometricPrecision" | ||
style="width: 1.6rem; height: 1.6rem;" | ||
> | ||
<use | ||
xlink:href="#information-filled:M" | ||
/> | ||
</svg> | ||
</span> | ||
<p | ||
class="theme-inlineMessage__contents" | ||
> | ||
<span> | ||
The information message value | ||
</span> | ||
</p> | ||
</div> | ||
<div | ||
aria-live="polite" | ||
class="theme-inlineMessage" | ||
role="status" | ||
> | ||
<span | ||
class="theme-icon theme-destructive__icon" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
pointer-events="none" | ||
shape-rendering="geometricPrecision" | ||
style="width: 1.6rem; height: 1.6rem;" | ||
> | ||
<use | ||
xlink:href="#square-cross:M" | ||
/> | ||
</svg> | ||
</span> | ||
<p | ||
class="theme-inlineMessage__contents" | ||
> | ||
<span> | ||
The destructive message value | ||
</span> | ||
</p> | ||
</div> | ||
<div | ||
aria-live="polite" | ||
class="theme-inlineMessage" | ||
role="status" | ||
> | ||
<span | ||
class="theme-icon theme-success__icon" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
pointer-events="none" | ||
shape-rendering="geometricPrecision" | ||
style="width: 1.6rem; height: 1.6rem;" | ||
> | ||
<use | ||
xlink:href="#check-filled:M" | ||
/> | ||
</svg> | ||
</span> | ||
<p | ||
class="theme-inlineMessage__contents" | ||
> | ||
<span> | ||
The success message value | ||
</span> | ||
</p> | ||
</div> | ||
<div | ||
aria-live="polite" | ||
class="theme-inlineMessage" | ||
role="status" | ||
> | ||
<span | ||
class="theme-icon theme-warning__icon" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
pointer-events="none" | ||
shape-rendering="geometricPrecision" | ||
style="width: 1.6rem; height: 1.6rem;" | ||
> | ||
<use | ||
xlink:href="#exclamation:M" | ||
/> | ||
</svg> | ||
</span> | ||
<p | ||
class="theme-inlineMessage__contents" | ||
> | ||
<span> | ||
The warning message value | ||
</span> | ||
</p> | ||
</div> | ||
<div | ||
aria-live="polite" | ||
class="theme-inlineMessage" | ||
role="status" | ||
> | ||
<span | ||
class="theme-icon theme-beta__icon" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
pointer-events="none" | ||
shape-rendering="geometricPrecision" | ||
style="width: 1.6rem; height: 1.6rem;" | ||
> | ||
<use | ||
xlink:href="#information-filled:M" | ||
/> | ||
</svg> | ||
</span> | ||
<p | ||
class="theme-inlineMessage__contents" | ||
> | ||
<span> | ||
The beta message value | ||
</span> | ||
</p> | ||
</div> | ||
</main> | ||
`; |
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 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { describe, it, expect } from '@jest/globals'; | ||
import { axe } from 'jest-axe'; | ||
import { render } from '@testing-library/react'; | ||
import { Link } from './'; | ||
|
||
describe('Link', () => { | ||
it('should render a11y html', async () => { | ||
const { container } = render( | ||
<main> | ||
<Link href="#" data-testid="my.link"> | ||
Link example | ||
</Link> | ||
<Link href="#" icon="information-filled"> | ||
Link example | ||
</Link> | ||
<Link href="https://www.talend.com">Link example</Link> | ||
</main>, | ||
); | ||
// eslint-disable-next-line testing-library/no-container | ||
container.querySelector('button')?.click(); | ||
expect(container.firstChild).toMatchSnapshot(); | ||
const results = await axe(document.body); | ||
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
69 changes: 69 additions & 0 deletions
69
packages/design-system/src/components/Link/__snapshots__/Link.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,69 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Link should render a11y html 1`] = ` | ||
<main> | ||
<a | ||
class="theme-linkable theme-link" | ||
data-testid="my.link" | ||
href="#" | ||
> | ||
<span | ||
class="theme-link__text" | ||
> | ||
Link example | ||
</span> | ||
</a> | ||
<a | ||
class="theme-linkable theme-link" | ||
href="#" | ||
> | ||
<span | ||
class="theme-link__icon" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
data-test="link.icon.before" | ||
data-testid="link.icon.before" | ||
pointer-events="none" | ||
shape-rendering="geometricPrecision" | ||
style="width: 1.6rem; height: 1.6rem;" | ||
> | ||
<use | ||
xlink:href="#information-filled:M" | ||
/> | ||
</svg> | ||
</span> | ||
<span | ||
class="theme-link__text" | ||
> | ||
Link example | ||
</span> | ||
</a> | ||
<a | ||
class="theme-linkable theme-link" | ||
href="https://www.talend.com" | ||
> | ||
<span | ||
class="theme-link__text" | ||
> | ||
Link example | ||
</span> | ||
<span | ||
class="theme-link__iconExternal" | ||
data-test="link.icon.external" | ||
data-testid="link.icon.external" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
pointer-events="none" | ||
shape-rendering="geometricPrecision" | ||
style="width: 1.2rem; height: 1.2rem;" | ||
> | ||
<use | ||
xlink:href="#external-link:S" | ||
/> | ||
</svg> | ||
</span> | ||
</a> | ||
</main> | ||
`; |
22 changes: 22 additions & 0 deletions
22
packages/design-system/src/components/LinkAsButton/LinkAsButton.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { describe, it, expect } from '@jest/globals'; | ||
import { axe } from 'jest-axe'; | ||
import { render } from '@testing-library/react'; | ||
import { LinkAsButton } from './'; | ||
|
||
describe('LinkAsButton', () => { | ||
it('should render a11y html', async () => { | ||
const { container } = render( | ||
<main> | ||
<LinkAsButton data-testid="my.link">Link example</LinkAsButton> | ||
<LinkAsButton icon="information-filled">Link example</LinkAsButton> | ||
<LinkAsButton openInNewTab>Link example</LinkAsButton> | ||
</main>, | ||
); | ||
// eslint-disable-next-line testing-library/no-container | ||
container.querySelector('button')?.click(); | ||
expect(container.firstChild).toMatchSnapshot(); | ||
const results = await axe(document.body); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
}); |
Oops, something went wrong.