-
Notifications
You must be signed in to change notification settings - Fork 385
/
index.js
31 lines (26 loc) · 949 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* External dependencies
*/
import { render } from 'enzyme';
/**
* Internal dependencies
*/
import ValidationErrorMessage from '../';
describe( 'ValidationErrorMessage', () => {
it( 'renders an error with a custom message', () => {
const errorMessage = render( <ValidationErrorMessage message="Hello World" /> );
expect( errorMessage ).toMatchSnapshot();
} );
it( 'renders an error with a title', () => {
const errorMessage = render( <ValidationErrorMessage title="Invalid attribute <code>onclick</code>" /> );
expect( errorMessage ).toMatchSnapshot();
} );
it( 'renders an error for a custom error code', () => {
const errorMessage = render( <ValidationErrorMessage code="some_other_error" /> );
expect( errorMessage ).toMatchSnapshot();
} );
it( 'renders an error for an unknown error code', () => {
const errorMessage = render( <ValidationErrorMessage /> );
expect( errorMessage ).toMatchSnapshot();
} );
} );