diff --git a/ui/components/component-library/tag/README.mdx b/ui/components/component-library/tag/README.mdx index 6d85e9e733c9..8892612c8631 100644 --- a/ui/components/component-library/tag/README.mdx +++ b/ui/components/component-library/tag/README.mdx @@ -19,3 +19,7 @@ The `Tag` accepts all props below as well as all [Box](/docs/ui-components-ui-bo ### Label The text content of the `Tag` component + + + + \ No newline at end of file diff --git a/ui/components/component-library/tag/__snapshots__/tag.test.js.snap b/ui/components/component-library/tag/__snapshots__/tag.test.js.snap new file mode 100644 index 000000000000..1cb53b117ab2 --- /dev/null +++ b/ui/components/component-library/tag/__snapshots__/tag.test.js.snap @@ -0,0 +1,16 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Tag should render the label inside the tag and match snapshot 1`] = ` +
+
+

+ Imported +

+
+
+`; diff --git a/ui/components/component-library/tag/tag.js b/ui/components/component-library/tag/tag.js index 9836c56497c5..5bdf52622d02 100644 --- a/ui/components/component-library/tag/tag.js +++ b/ui/components/component-library/tag/tag.js @@ -15,7 +15,7 @@ import { export const Tag = ({ label, className, labelProps, ...props }) => { return ( ; DefaultStory.storyName = 'Default'; + +export const Label = (args) => Anchor Element; + +Label.args = { + label: 'Label Story', +}; diff --git a/ui/components/component-library/tag/tag.test.js b/ui/components/component-library/tag/tag.test.js index c4ed721869e0..dd5000ebc121 100644 --- a/ui/components/component-library/tag/tag.test.js +++ b/ui/components/component-library/tag/tag.test.js @@ -5,9 +5,12 @@ import React from 'react'; import { Tag } from './tag'; describe('Tag', () => { - it('should render the label inside the tag', () => { - const { getByTestId } = render(); + it('should render the label inside the tag and match snapshot', () => { + const { getByTestId, container } = render( + , + ); expect(getByTestId('tag')).toBeDefined(); expect(getByTestId('tag')).toHaveTextContent('Imported'); + expect(container).toMatchSnapshot(); }); });