1- import { getDefaultValue } from " ../getDefaultValue" ;
1+ import { getDefaultValue } from ' ../getDefaultValue'
22
33test ( 'getDefaultValue returns defaultStateValue when defaultProp is undefined' , ( ) => {
4- const defaultStateValue = 'defaultState' ;
5- const result = getDefaultValue ( undefined , defaultStateValue ) ;
6- expect ( result ) . toBe ( defaultStateValue ) ;
7- } ) ;
4+ const defaultStateValue = 'defaultState'
5+ const result = getDefaultValue ( undefined , defaultStateValue )
6+ expect ( result ) . toBe ( defaultStateValue )
7+ } )
88
99test ( 'getDefaultValue returns defaultProp when it is defined' , ( ) => {
10- const defaultProp = 'defaultProp' ;
11- const defaultStateValue = 'defaultState' ;
12- const result = getDefaultValue ( defaultProp , defaultStateValue ) ;
13- expect ( result ) . toBe ( defaultProp ) ;
14- } ) ;
10+ const defaultProp = 'defaultProp'
11+ const defaultStateValue = 'defaultState'
12+ const result = getDefaultValue ( defaultProp , defaultStateValue )
13+ expect ( result ) . toBe ( defaultProp )
14+ } )
15+
16+ test ( 'getDefaultValue returns defaultProp even when is null' , ( ) => {
17+ const defaultStateValue = 'defaultState'
18+ const result = getDefaultValue ( null , defaultStateValue )
19+ expect ( result ) . toBe ( null )
20+ } )
21+
22+ test ( 'getDefaultValue returns defaultStateValue even when null' , ( ) => {
23+ const result = getDefaultValue ( undefined , null )
24+ expect ( result ) . toBe ( null )
25+ } )
0 commit comments