Browse Source

test: add basic Message component test

renovate/lint-staged-8.x
Tom Kirkpatrick 6 years ago
parent
commit
706db98442
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 11
      test/unit/components/UI/Message.spec.js
  2. 17
      test/unit/components/UI/__snapshots__/Message.spec.js.snap

11
test/unit/components/UI/Message.spec.js

@ -0,0 +1,11 @@
import React from 'react'
import { shallow } from 'enzyme'
import toJSON from 'enzyme-to-json'
import { Message } from 'components/UI'
describe('component.UI.Message', () => {
it('should render correctly with default props', () => {
const wrapper = shallow(<Message>A message</Message>)
expect(toJSON(wrapper)).toMatchSnapshot()
})
})

17
test/unit/components/UI/__snapshots__/Message.spec.js.snap

@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`component.UI.Message should render correctly with default props 1`] = `
<Styled(Styled(styled.div))
alignItems="center"
>
<styled.div
mr={1}
/>
<Styled(styled.div)
fontSize="s"
fontWeight="normal"
>
A message
</Styled(styled.div)>
</Styled(Styled(styled.div))>
`;
Loading…
Cancel
Save