8
8
9
9
import React from 'react' ;
10
10
import { Text } from 'react-native' ;
11
- import createComponentWithGlobalize from '../../../utils/createComponentWithGlobalize ' ;
12
- import FormattedMessage from '../FormattedMessage' ;
11
+ import createWithGlobalize from '../../../test/createWithGlobalize ' ;
12
+ import { FormattedMessage } from '../FormattedMessage' ;
13
13
14
14
const messages = {
15
15
en : {
@@ -21,26 +21,26 @@ const messages = {
21
21
22
22
describe ( '<FormattedMessage />' , ( ) => {
23
23
test ( 'renders correctly' , ( ) => {
24
- const tree = createComponentWithGlobalize ( < FormattedMessage message = "test" /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
24
+ const tree = createWithGlobalize ( < FormattedMessage message = "test" /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
25
25
26
26
expect ( tree ) . toMatchSnapshot ( ) ;
27
27
} ) ;
28
28
29
29
describe ( 'values' , ( ) => {
30
30
test ( 'replaces variables using values prop' , ( ) => {
31
- const tree = createComponentWithGlobalize ( < FormattedMessage message = "hello" values = { { name : 'Josh' } } /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
31
+ const tree = createWithGlobalize ( < FormattedMessage message = "hello" values = { { name : 'Josh' } } /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
32
32
33
33
expect ( tree ) . toMatchSnapshot ( ) ;
34
34
} ) ;
35
35
36
36
test ( 'uses props passed directly to component' , ( ) => {
37
- const tree = createComponentWithGlobalize ( < FormattedMessage message = "hello" name = "Josh" /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
37
+ const tree = createWithGlobalize ( < FormattedMessage message = "hello" name = "Josh" /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
38
38
39
39
expect ( tree ) . toMatchSnapshot ( ) ;
40
40
} ) ;
41
41
42
42
test ( 'renders component values' , ( ) => {
43
- const tree = createComponentWithGlobalize ( < FormattedMessage message = "date" date = { < Text > 1/1/2019</ Text > } /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
43
+ const tree = createWithGlobalize ( < FormattedMessage message = "date" date = { < Text > 1/1/2019</ Text > } /> , { currency : 'USD' , locale : 'en' , messages } ) . toJSON ( ) ;
44
44
45
45
expect ( tree ) . toMatchSnapshot ( ) ;
46
46
} ) ;
0 commit comments