@@ -514,6 +514,59 @@ describe('sprinkles', () => {
514514 expect ( value ) . toMatchInlineSnapshot ( `"123_mobile"` ) ;
515515 } ) ;
516516
517+ it ( 'should handle booleans' , ( ) => {
518+ const mapValue = createMapValueFn ( conditionalAtomicStyles ) ;
519+ const value = mapValue ( 123 , ( ) => false ) ;
520+
521+ expect ( value ) . toBe ( false ) ;
522+ } ) ;
523+
524+ it ( 'should handle conditional booleans' , ( ) => {
525+ const mapValue = createMapValueFn ( conditionalAtomicStyles ) ;
526+ const value = mapValue (
527+ { mobile : 1 , tablet : 2 , desktop : 3 } ,
528+ ( value ) => value === 2 ,
529+ ) ;
530+
531+ expect ( value ) . toStrictEqual ( {
532+ mobile : false ,
533+ tablet : true ,
534+ desktop : false ,
535+ } ) ;
536+ } ) ;
537+
538+ it ( 'should handle nulls' , ( ) => {
539+ const mapValue = createMapValueFn ( conditionalAtomicStyles ) ;
540+ const value = mapValue ( 123 , ( ) => null ) ;
541+
542+ expect ( value ) . toBe ( null ) ;
543+ } ) ;
544+
545+ it ( 'should handle conditional nulls' , ( ) => {
546+ const mapValue = createMapValueFn ( conditionalAtomicStyles ) ;
547+ const value = mapValue ( { mobile : 1 , tablet : 2 , desktop : 3 } , ( value ) =>
548+ value === 2 ? null : value ,
549+ ) ;
550+
551+ expect ( value ) . toStrictEqual ( { mobile : 1 , tablet : null , desktop : 3 } ) ;
552+ } ) ;
553+
554+ it ( 'should handle undefined' , ( ) => {
555+ const mapValue = createMapValueFn ( conditionalAtomicStyles ) ;
556+ const value = mapValue ( 123 , ( ) => undefined ) ;
557+
558+ expect ( value ) . toBe ( undefined ) ;
559+ } ) ;
560+
561+ it ( 'should handle conditional undefined' , ( ) => {
562+ const mapValue = createMapValueFn ( conditionalAtomicStyles ) ;
563+ const value = mapValue ( { mobile : 1 , tablet : 2 , desktop : 3 } , ( value ) =>
564+ value === 2 ? undefined : value ,
565+ ) ;
566+
567+ expect ( value ) . toStrictEqual ( { mobile : 1 , tablet : undefined , desktop : 3 } ) ;
568+ } ) ;
569+
517570 it ( 'should handle responsive arrays' , ( ) => {
518571 const map = createMapValueFn ( conditionalAtomicStyles ) ;
519572 const value = map ( [ 'one' ] , ( value , key ) => `${ value } _${ key } ` as const ) ;
0 commit comments