diff --git a/components/lib/badge/Badge.spec.js b/components/lib/badge/Badge.spec.js index 217c5bce6b..99f7f3a3cb 100644 --- a/components/lib/badge/Badge.spec.js +++ b/components/lib/badge/Badge.spec.js @@ -2,19 +2,17 @@ import '@testing-library/jest-dom'; import { render } from '@testing-library/react'; import { Badge } from './Badge'; -const snapshot = (props, name) => expect(render().container).toMatchSnapshot(name); +import { snapshot } from '../../test'; describe('Badge', () => { - test('check snapshots', () => { - snapshot({}, 'default'); - snapshot({ value: 22 }, 'value'); - snapshot({ size: 'large' }, 'size large'); - snapshot({ size: 'xlarge' }, 'size xlarge'); - snapshot({ size: 'invalid' }, 'size invalid'); - snapshot({ severity: 'success' }, 'severity success'); - snapshot({ severity: 'info' }, 'severity info'); - snapshot({ severity: 'warning' }, 'severity warning'); - snapshot({ severity: 'danger' }, 'severity danger'); - snapshot({ severity: 'invalid' }, 'severity invalid'); - }); + snapshot(, 'default'); + snapshot(, 'value'); + snapshot(, 'size large'); + snapshot(, 'size xlarge'); + snapshot(, 'size invalid'); + snapshot(, 'severity success'); + snapshot(, 'severity info'); + snapshot(, 'severity warning'); + snapshot(, 'severity danger'); + snapshot(, 'severity invalid'); }); diff --git a/components/lib/badge/__snapshots__/Badge.spec.js.snap b/components/lib/badge/__snapshots__/Badge.spec.js.snap index 5cc7fffc06..b7be21aa04 100644 --- a/components/lib/badge/__snapshots__/Badge.spec.js.snap +++ b/components/lib/badge/__snapshots__/Badge.spec.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Badge check snapshots: default 1`] = ` +exports[`Badge default 1`] = `
`; -exports[`Badge check snapshots: severity danger 1`] = ` +exports[`Badge severity danger 1`] = `
`; -exports[`Badge check snapshots: severity info 1`] = ` +exports[`Badge severity info 1`] = `
`; -exports[`Badge check snapshots: severity invalid 1`] = ` +exports[`Badge severity invalid 1`] = `
`; -exports[`Badge check snapshots: severity success 1`] = ` +exports[`Badge severity success 1`] = `
`; -exports[`Badge check snapshots: severity warning 1`] = ` +exports[`Badge severity warning 1`] = `
`; -exports[`Badge check snapshots: size invalid 1`] = ` +exports[`Badge size invalid 1`] = `
`; -exports[`Badge check snapshots: size large 1`] = ` +exports[`Badge size large 1`] = `
`; -exports[`Badge check snapshots: size xlarge 1`] = ` +exports[`Badge size xlarge 1`] = `
`; -exports[`Badge check snapshots: value 1`] = ` +exports[`Badge value 1`] = `
{ - test('when visible is false Button return null', () => { - // Arrange - const { container } = render(