@@ -170,6 +170,59 @@ describe('mergePropsToResponsive', () => {
170170 display : [ 'none' , null , 'flex' ] ,
171171 } ,
172172 } ,
173+ {
174+ name : 'flexDir column at mobile, row at tablet and pc should produce responsive array' ,
175+ input : new Map < BreakpointKey , Record < string , unknown > > ( [
176+ [ 'mobile' , { flexDir : 'column' } ] ,
177+ [ 'tablet' , { flexDir : 'row' } ] ,
178+ [ 'pc' , { flexDir : 'row' } ] ,
179+ ] ) ,
180+ expected : {
181+ flexDir : [ 'column' , null , 'row' ] ,
182+ } ,
183+ } ,
184+ {
185+ name : 'alignItems with default value at first should become null' ,
186+ input : new Map < BreakpointKey , Record < string , unknown > > ( [
187+ [ 'mobile' , { alignItems : 'flex-start' } ] ,
188+ [ 'tablet' , { alignItems : 'center' } ] ,
189+ [ 'pc' , { alignItems : 'center' } ] ,
190+ ] ) ,
191+ expected : {
192+ alignItems : [ null , null , 'center' ] ,
193+ } ,
194+ } ,
195+ {
196+ name : 'justifyContent with default value at first should become null' ,
197+ input : new Map < BreakpointKey , Record < string , unknown > > ( [
198+ [ 'mobile' , { justifyContent : 'flex-start' } ] ,
199+ [ 'tablet' , { justifyContent : 'center' } ] ,
200+ [ 'pc' , { justifyContent : 'center' } ] ,
201+ ] ) ,
202+ expected : {
203+ justifyContent : [ null , null , 'center' ] ,
204+ } ,
205+ } ,
206+ {
207+ name : 'flexDir with default value (row) at first should become null' ,
208+ input : new Map < BreakpointKey , Record < string , unknown > > ( [
209+ [ 'mobile' , { flexDir : 'row' } ] ,
210+ [ 'tablet' , { flexDir : 'column' } ] ,
211+ [ 'pc' , { flexDir : 'column' } ] ,
212+ ] ) ,
213+ expected : {
214+ flexDir : [ null , null , 'column' ] ,
215+ } ,
216+ } ,
217+ {
218+ name : 'all default values should be omitted (empty result)' ,
219+ input : new Map < BreakpointKey , Record < string , unknown > > ( [
220+ [ 'mobile' , { alignItems : 'flex-start' , justifyContent : 'flex-start' } ] ,
221+ [ 'tablet' , { alignItems : 'flex-start' , justifyContent : 'flex-start' } ] ,
222+ [ 'pc' , { alignItems : 'flex-start' , justifyContent : 'flex-start' } ] ,
223+ ] ) ,
224+ expected : { } ,
225+ } ,
173226 ]
174227
175228 cases . forEach ( ( { name, input, expected } ) => {
0 commit comments