ignite-jhipster
Version:
A React Native boilerplate for JHipster apps.
21 lines (16 loc) • 792 B
JavaScript
import 'react-native'
import React from 'react'
import renderer from 'react-test-renderer'
import AlertMessage from '../../../../../app/shared/components/alert-message/alert-message'
test('AlertMessage component renders correctly if show is true', () => {
const tree = renderer.create(<AlertMessage title='howdy' />).toJSON()
expect(tree).toMatchSnapshot()
})
test('AlertMessage component does not render if show is false', () => {
const tree = renderer.create(<AlertMessage title='howdy' show={false} />).toJSON()
expect(tree).toMatchSnapshot()
})
test('AlertMessage component renders correctly if backgroundColor prop is set', () => {
const tree = renderer.create(<AlertMessage title='howdy' style={{ backgroundColor: 'red' }} />).toJSON()
expect(tree).toMatchSnapshot()
})