+ Item A
+ Item B
+ Item C
+ >
+ ),
+ 'onChange': () => {},
+ 'small': true,
+ }}
+ xAxis={{
+ 'small': {},
+ 'with placeholder': { placeholder: 'Placeholder' },
+ 'with value': { value: 'b' },
+ 'multiple': { multiple: true, size: 3 },
+ }}
+ yAxis={{
+ 'small': {},
+ 'hover': { className: 'hover' },
+ 'active': { className: 'active' },
+ 'focus': { className: 'focus' },
+ 'disabled': { disabled: true },
+ 'errored': { error: 'Error' },
+ 'errored + hover': { className: 'hover', error: 'Error' },
+ 'errored + active': { className: 'active', error: 'Error' },
+ 'errored + focus': { className: 'focus', error: 'Error' },
+ }}
+ />
+ >
);
diff --git a/packages/fuselage/src/components/SelectInput/__snapshots__/SelectInput.spec.tsx.snap b/packages/fuselage/src/components/SelectInput/__snapshots__/SelectInput.spec.tsx.snap
new file mode 100644
index 0000000000..3a89177968
--- /dev/null
+++ b/packages/fuselage/src/components/SelectInput/__snapshots__/SelectInput.spec.tsx.snap
@@ -0,0 +1,46 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`[SelectInput Component] renders without crashing 1`] = `
+
+
+
+
+
+`;
diff --git a/packages/fuselage/src/components/TelephoneInput/TelephoneInput.spec.tsx b/packages/fuselage/src/components/TelephoneInput/TelephoneInput.spec.tsx
index 7d5cbe55af..b66857bc7a 100644
--- a/packages/fuselage/src/components/TelephoneInput/TelephoneInput.spec.tsx
+++ b/packages/fuselage/src/components/TelephoneInput/TelephoneInput.spec.tsx
@@ -1,10 +1,22 @@
+import { composeStories } from '@storybook/testing-react';
import { render } from '@testing-library/react';
+import { axe } from 'jest-axe';
import React from 'react';
-import { TelephoneInput } from '.';
+import * as stories from './TelephoneInput.stories';
+
+const { Default } = composeStories(stories);
describe('[TelephoneInput Component]', () => {
it('renders without crashing', () => {
- render();
+ const tree = render();
+ expect(tree.baseElement).toMatchSnapshot();
+ });
+
+ it('%s should have no a11y violations', async () => {
+ const { container } = render();
+
+ const results = await axe(container);
+ expect(results).toHaveNoViolations();
});
});
diff --git a/packages/fuselage/src/components/TelephoneInput/TelephoneInput.stories.tsx b/packages/fuselage/src/components/TelephoneInput/TelephoneInput.stories.tsx
index bc468092b9..9fd60d56c8 100644
--- a/packages/fuselage/src/components/TelephoneInput/TelephoneInput.stories.tsx
+++ b/packages/fuselage/src/components/TelephoneInput/TelephoneInput.stories.tsx
@@ -26,7 +26,7 @@ export default {
} as ComponentMeta;
const Template: ComponentStory = (args) => (
-
+
);
export const Default: ComponentStory = Template.bind({});
@@ -57,28 +57,58 @@ WithValue.args = {
};
export const States: ComponentStory = () => (
- {} }}
- xAxis={{
- 'default': {},
- 'with placeholder': { placeholder: 'Placeholder' },
- 'with value': { value: '+1234567890' },
- 'with icon': {
- addon: ,
- value: '+1234567890',
- },
- }}
- yAxis={{
- 'default': {},
- 'hover': { className: 'hover' },
- 'active': { className: 'active' },
- 'focus': { className: 'focus' },
- 'disabled': { disabled: true },
- 'errored': { error: 'Error' },
- 'errored + hover': { className: 'hover', error: 'Error' },
- 'errored + active': { className: 'active', error: 'Error' },
- 'errored + focus': { className: 'focus', error: 'Error' },
- }}
- />
+ <>
+ {}, 'aria-label': 'telephone' }}
+ xAxis={{
+ 'default': {},
+ 'with placeholder': { placeholder: 'Placeholder' },
+ 'with value': { value: '+1234567890' },
+ 'with icon': {
+ addon: ,
+ value: '+1234567890',
+ },
+ }}
+ yAxis={{
+ 'default': {},
+ 'hover': { className: 'hover' },
+ 'active': { className: 'active' },
+ 'focus': { className: 'focus' },
+ 'disabled': { disabled: true },
+ 'errored': { error: 'Error' },
+ 'errored + hover': { className: 'hover', error: 'Error' },
+ 'errored + active': { className: 'active', error: 'Error' },
+ 'errored + focus': { className: 'focus', error: 'Error' },
+ }}
+ />
+ {},
+ 'small': true,
+ 'aria-label': 'telephone',
+ }}
+ xAxis={{
+ 'small': {},
+ 'with placeholder': { placeholder: 'Placeholder' },
+ 'with value': { value: '+1234567890' },
+ 'with icon': {
+ addon: ,
+ value: '+1234567890',
+ },
+ }}
+ yAxis={{
+ 'small': {},
+ 'hover': { className: 'hover' },
+ 'active': { className: 'active' },
+ 'focus': { className: 'focus' },
+ 'disabled': { disabled: true },
+ 'errored': { error: 'Error' },
+ 'errored + hover': { className: 'hover', error: 'Error' },
+ 'errored + active': { className: 'active', error: 'Error' },
+ 'errored + focus': { className: 'focus', error: 'Error' },
+ }}
+ />
+ >
);
diff --git a/packages/fuselage/src/components/TelephoneInput/__snapshots__/TelephoneInput.spec.tsx.snap b/packages/fuselage/src/components/TelephoneInput/__snapshots__/TelephoneInput.spec.tsx.snap
new file mode 100644
index 0000000000..e6b540160d
--- /dev/null
+++ b/packages/fuselage/src/components/TelephoneInput/__snapshots__/TelephoneInput.spec.tsx.snap
@@ -0,0 +1,14 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`[TelephoneInput Component] renders without crashing 1`] = `
+
+
+
+
+
+`;
diff --git a/packages/fuselage/src/components/TextInput/TextInput.spec.tsx b/packages/fuselage/src/components/TextInput/TextInput.spec.tsx
index bc9d399891..4d78e3376f 100644
--- a/packages/fuselage/src/components/TextInput/TextInput.spec.tsx
+++ b/packages/fuselage/src/components/TextInput/TextInput.spec.tsx
@@ -1,10 +1,22 @@
+import { composeStories } from '@storybook/testing-react';
import { render } from '@testing-library/react';
+import { axe } from 'jest-axe';
import React from 'react';
-import { TextInput } from '.';
+import * as stories from './TextInput.stories';
-describe('[TextInput]', () => {
+const { Default } = composeStories(stories);
+
+describe('[TextInput Component]', () => {
it('renders without crashing', () => {
- render();
+ const tree = render();
+ expect(tree.baseElement).toMatchSnapshot();
+ });
+
+ it('%s should have no a11y violations', async () => {
+ const { container } = render();
+
+ const results = await axe(container);
+ expect(results).toHaveNoViolations();
});
});
diff --git a/packages/fuselage/src/components/TextInput/TextInput.stories.tsx b/packages/fuselage/src/components/TextInput/TextInput.stories.tsx
index fa090e2865..88829e6984 100644
--- a/packages/fuselage/src/components/TextInput/TextInput.stories.tsx
+++ b/packages/fuselage/src/components/TextInput/TextInput.stories.tsx
@@ -26,7 +26,7 @@ export default {
} as ComponentMeta;
const Template: ComponentStory = (args) => (
-
+
);
export const Default: ComponentStory = Template.bind({});
@@ -61,28 +61,54 @@ WithValue.args = {
};
export const States: ComponentStory = () => (
- {} }}
- xAxis={{
- 'default': {},
- 'with placeholder': { placeholder: 'Placeholder' },
- 'with value': { value: 'Value' },
- 'with icon': {
- addon: ,
- value: 'Value',
- },
- }}
- yAxis={{
- 'default': {},
- 'hover': { className: 'hover' },
- 'active': { className: 'active' },
- 'focus': { className: 'focus' },
- 'disabled': { disabled: true },
- 'errored': { error: 'Error' },
- 'errored + hover': { className: 'hover', error: 'Error' },
- 'errored + active': { className: 'active', error: 'Error' },
- 'errored + focus': { className: 'focus', error: 'Error' },
- }}
- />
+ <>
+ {}, 'aria-label': 'text' }}
+ xAxis={{
+ 'default': {},
+ 'with placeholder': { placeholder: 'Placeholder' },
+ 'with value': { value: 'Value' },
+ 'with icon': {
+ addon: ,
+ value: 'Value',
+ },
+ }}
+ yAxis={{
+ 'default': {},
+ 'hover': { className: 'hover' },
+ 'active': { className: 'active' },
+ 'focus': { className: 'focus' },
+ 'disabled': { disabled: true },
+ 'errored': { error: 'Error' },
+ 'errored + hover': { className: 'hover', error: 'Error' },
+ 'errored + active': { className: 'active', error: 'Error' },
+ 'errored + focus': { className: 'focus', error: 'Error' },
+ }}
+ />
+ {}, 'small': true, 'aria-label': 'text' }}
+ xAxis={{
+ 'small': {},
+ 'with placeholder': { placeholder: 'Placeholder' },
+ 'with value': { value: 'Value' },
+ 'with icon': {
+ addon: ,
+ value: 'Value',
+ },
+ }}
+ yAxis={{
+ 'small': {},
+ 'hover': { className: 'hover' },
+ 'active': { className: 'active' },
+ 'focus': { className: 'focus' },
+ 'disabled': { disabled: true },
+ 'errored': { error: 'Error' },
+ 'errored + hover': { className: 'hover', error: 'Error' },
+ 'errored + active': { className: 'active', error: 'Error' },
+ 'errored + focus': { className: 'focus', error: 'Error' },
+ }}
+ />
+ >
);
diff --git a/packages/fuselage/src/components/TextInput/__snapshots__/TextInput.spec.tsx.snap b/packages/fuselage/src/components/TextInput/__snapshots__/TextInput.spec.tsx.snap
new file mode 100644
index 0000000000..3dee7439fa
--- /dev/null
+++ b/packages/fuselage/src/components/TextInput/__snapshots__/TextInput.spec.tsx.snap
@@ -0,0 +1,14 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`[TextInput Component] renders without crashing 1`] = `
+
+
+
+
+
+`;
diff --git a/packages/fuselage/src/components/UrlInput/UrlInput.spec.tsx b/packages/fuselage/src/components/UrlInput/UrlInput.spec.tsx
index c86b8a6572..34a1f77195 100644
--- a/packages/fuselage/src/components/UrlInput/UrlInput.spec.tsx
+++ b/packages/fuselage/src/components/UrlInput/UrlInput.spec.tsx
@@ -1,10 +1,22 @@
+import { composeStories } from '@storybook/testing-react';
import { render } from '@testing-library/react';
+import { axe } from 'jest-axe';
import React from 'react';
-import UrlInput from '.';
+import * as stories from './UrlInput.stories';
+
+const { Default } = composeStories(stories);
describe('[UrlInput Component]', () => {
it('renders without crashing', () => {
- render();
+ const tree = render();
+ expect(tree.baseElement).toMatchSnapshot();
+ });
+
+ it('%s should have no a11y violations', async () => {
+ const { container } = render();
+
+ const results = await axe(container);
+ expect(results).toHaveNoViolations();
});
});
diff --git a/packages/fuselage/src/components/UrlInput/UrlInput.stories.tsx b/packages/fuselage/src/components/UrlInput/UrlInput.stories.tsx
index 0b9bbed52f..2710a10730 100644
--- a/packages/fuselage/src/components/UrlInput/UrlInput.stories.tsx
+++ b/packages/fuselage/src/components/UrlInput/UrlInput.stories.tsx
@@ -1,7 +1,8 @@
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
import React from 'react';
import { Icon, UrlInput } from '../..';
-import PropsVariation from '../../.storybook/PropsVariation';
+import { PropsVariationSection } from '../../../.storybook/helpers';
export default {
title: 'Inputs/UrlInput',
@@ -9,45 +10,81 @@ export default {
parameters: {
jest: ['UrlInput.spec.tsx'],
},
-};
+} as ComponentMeta;
-export const Default = () => ;
+export const Default: ComponentStory = () => (
+
+);
export const WithIconAddon = () => (
- } />
+ } />
);
-export const Invalid = () => ;
+export const Invalid = () => ;
-export const Disabled = () => ;
+export const Disabled = () => ;
-export const WithPlaceholder = () => ;
+export const WithPlaceholder = () => (
+
+);
-export const WithValue = () => ;
+export const WithValue = () => (
+
+);
export const States = () => (
- undefined }}
- xAxis={{
- 'default': {},
- 'with placeholder': { placeholder: 'Placeholder' },
- 'with value': { value: 'https://rocket.chat' },
- 'with icon': {
- addon: ,
- value: 'https://rocket.chat',
- },
- }}
- yAxis={{
- 'default': {},
- 'hover': { className: 'hover' },
- 'active': { className: 'active' },
- 'focus': { className: 'focus' },
- 'disabled': { disabled: true },
- 'errored': { error: 'Error' },
- 'errored + hover': { className: 'hover', error: 'Error' },
- 'errored + active': { className: 'active', error: 'Error' },
- 'errored + focus': { className: 'focus', error: 'Error' },
- }}
- />
+ <>
+ undefined, 'aria-label': 'url' }}
+ xAxis={{
+ 'default': {},
+ 'with placeholder': { placeholder: 'Placeholder' },
+ 'with value': { value: 'https://rocket.chat' },
+ 'with icon': {
+ addon: ,
+ value: 'https://rocket.chat',
+ },
+ }}
+ yAxis={{
+ 'default': {},
+ 'hover': { className: 'hover' },
+ 'active': { className: 'active' },
+ 'focus': { className: 'focus' },
+ 'disabled': { disabled: true },
+ 'errored': { error: 'Error' },
+ 'errored + hover': { className: 'hover', error: 'Error' },
+ 'errored + active': { className: 'active', error: 'Error' },
+ 'errored + focus': { className: 'focus', error: 'Error' },
+ }}
+ />
+ undefined,
+ 'small': true,
+ 'aria-label': 'url',
+ }}
+ xAxis={{
+ 'small': {},
+ 'with placeholder': { placeholder: 'Placeholder' },
+ 'with value': { value: 'https://rocket.chat' },
+ 'with icon': {
+ addon: ,
+ value: 'https://rocket.chat',
+ },
+ }}
+ yAxis={{
+ 'small': {},
+ 'hover': { className: 'hover' },
+ 'active': { className: 'active' },
+ 'focus': { className: 'focus' },
+ 'disabled': { disabled: true },
+ 'errored': { error: 'Error' },
+ 'errored + hover': { className: 'hover', error: 'Error' },
+ 'errored + active': { className: 'active', error: 'Error' },
+ 'errored + focus': { className: 'focus', error: 'Error' },
+ }}
+ />
+ >
);
diff --git a/packages/fuselage/src/components/UrlInput/__snapshots__/UrlInput.spec.tsx.snap b/packages/fuselage/src/components/UrlInput/__snapshots__/UrlInput.spec.tsx.snap
new file mode 100644
index 0000000000..edb66a68d2
--- /dev/null
+++ b/packages/fuselage/src/components/UrlInput/__snapshots__/UrlInput.spec.tsx.snap
@@ -0,0 +1,14 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`[UrlInput Component] renders without crashing 1`] = `
+
+
+
+
+
+`;