1
1
import React from 'react' ;
2
2
import Base from '../../src/Base' ;
3
3
4
+ // Missing locale test
5
+ it ( 'throws error for missing required locale' , ( ) => {
6
+ const messages = { Terra : 'Terra' } ;
7
+
8
+ try {
9
+ shallow ( < Base customMessages = { messages } > String</ Base > ) ;
10
+ } catch ( e ) {
11
+ expect ( e . message ) . toContain ( 'Missing locale prop' ) ;
12
+ }
13
+ } ) ;
14
+
4
15
// Snapshot Tests
5
- it ( 'should support rendering a string without translation ' , ( ) => {
16
+ it ( 'should support rendering a string' , ( ) => {
6
17
const base = shallow ( < Base > String</ Base > ) ;
7
18
expect ( base ) . toMatchSnapshot ( ) ;
8
19
} ) ;
9
20
10
- it ( 'should support rendering an array of children without translation ' , ( ) => {
21
+ it ( 'should support rendering an array of children' , ( ) => {
11
22
/* eslint-disable comma-dangle */
12
23
const base = shallow (
13
24
< Base >
@@ -19,18 +30,7 @@ it('should support rendering an array of children without translation', () => {
19
30
/* eslint-enable comma-dangle */
20
31
} ) ;
21
32
22
- // Snapshot Tests
23
- it ( 'should render with stict mode when strict mode enabled' , ( ) => {
33
+ it ( 'should render with strict mode when strict mode enabled' , ( ) => {
24
34
const base = shallow ( < Base strictMode > String</ Base > ) ;
25
35
expect ( base ) . toMatchSnapshot ( ) ;
26
36
} ) ;
27
-
28
- it ( 'throws error for missing required locale' , ( ) => {
29
- const messages = { Terra : 'Terra' } ;
30
-
31
- try {
32
- shallow ( < Base customMessages = { messages } > String</ Base > ) ;
33
- } catch ( e ) {
34
- expect ( e . message ) . toContain ( 'Missing locale prop' ) ;
35
- }
36
- } ) ;
0 commit comments