10
10
11
11
'use strict' ;
12
12
13
- const processLayoutProps = require ( '../processStyles' ) ;
13
+ const processStyles = require ( '../processStyles' ) ;
14
14
15
- describe ( 'processLayoutProps ' , ( ) => {
15
+ describe ( 'processStyles ' , ( ) => {
16
16
it ( 'it should map layout style properties' , ( ) => {
17
17
const style = {
18
18
backgroundColor : 'white' ,
@@ -30,7 +30,7 @@ describe('processLayoutProps', () => {
30
30
paddingInline : 120 ,
31
31
verticalAlign : 'middle' ,
32
32
} ;
33
- const processedStyle = processLayoutProps ( style ) ;
33
+ const processedStyle = processStyles ( style ) ;
34
34
expect ( processedStyle ) . toMatchInlineSnapshot ( `
35
35
Object {
36
36
"backgroundColor": "white",
@@ -53,26 +53,26 @@ describe('processLayoutProps', () => {
53
53
54
54
it ( 'should override style properties' , ( ) => {
55
55
const style = { marginStart : 20 , marginInlineStart : 40 } ;
56
- const processedStyle = processLayoutProps ( style ) ;
56
+ const processedStyle = processStyles ( style ) ;
57
57
expect ( processedStyle . marginStart ) . toBe ( 40 ) ;
58
58
} ) ;
59
59
60
60
it ( 'should overwrite properties with `undefined`' , ( ) => {
61
61
const style = { marginInlineStart : 40 , marginStart : undefined } ;
62
- const processedStyle = processLayoutProps ( style ) ;
62
+ const processedStyle = processStyles ( style ) ;
63
63
expect ( processedStyle . marginStart ) . toBe ( 40 ) ;
64
64
} ) ;
65
65
66
66
it ( 'should not fail on falsy values' , ( ) => {
67
- expect ( ( ) => processLayoutProps ( { } ) ) . not . toThrow ( ) ;
68
- expect ( ( ) => processLayoutProps ( null ) ) . not . toThrow ( ) ;
69
- expect ( ( ) => processLayoutProps ( false ) ) . not . toThrow ( ) ;
70
- expect ( ( ) => processLayoutProps ( undefined ) ) . not . toThrow ( ) ;
67
+ expect ( ( ) => processStyles ( { } ) ) . not . toThrow ( ) ;
68
+ expect ( ( ) => processStyles ( null ) ) . not . toThrow ( ) ;
69
+ expect ( ( ) => processStyles ( false ) ) . not . toThrow ( ) ;
70
+ expect ( ( ) => processStyles ( undefined ) ) . not . toThrow ( ) ;
71
71
} ) ;
72
72
73
73
it ( 'should not change style if there is no layout style property' , ( ) => {
74
74
const style = { backgroundColor : '#000' , width : 10 } ;
75
- const processedStyle = processLayoutProps ( style ) ;
75
+ const processedStyle = processStyles ( style ) ;
76
76
expect ( processedStyle ) . toStrictEqual ( style ) ;
77
77
} ) ;
78
78
} ) ;
0 commit comments