@@ -311,6 +311,7 @@ describe("styed-tidy", () => {
311311 expect ( rem ( 4 ) ) . toBe ( "0.25rem" ) ;
312312 expect ( rem ( 16 , 8 ) ) . toBe ( "2rem" ) ;
313313 expect ( rem ( 16 , 32 ) ) . toBe ( "0.5rem" ) ;
314+ expect ( rem ( 0 ) ) . toBe ( "0" ) ;
314315 } ) ;
315316 } ) ;
316317
@@ -364,7 +365,7 @@ describe("styed-tidy", () => {
364365 } ) ;
365366
366367 describe ( "'grid' mixin" , ( ) => {
367- it ( "sets the given grid CSS attributes" , ( ) => {
368+ it ( "sets the given grid CSS attributes from numbers " , ( ) => {
368369 const Test = styled . div < TestProps > `
369370 ${ grid ( 4 , 16 , 24 ) } ;
370371 ` ;
@@ -377,6 +378,17 @@ describe("styed-tidy", () => {
377378 expect ( test ) . toHaveStyleRule ( "grid-row-gap" , "1.5rem" ) ;
378379 } ) ;
379380
381+ it ( "sets the given grid CSS attributes from strings" , ( ) => {
382+ const Test = styled . div < TestProps > `
383+ ${ grid ( 4 , "2rem" , "3rem" ) } ;
384+ ` ;
385+ const { getByText } = setup ( < Test > test</ Test > ) ;
386+ const test = getByText ( "test" ) ;
387+
388+ expect ( test ) . toHaveStyleRule ( "grid-column-gap" , "2rem" ) ;
389+ expect ( test ) . toHaveStyleRule ( "grid-row-gap" , "3rem" ) ;
390+ } ) ;
391+
380392 it ( "sets the row gap equal to the column gap when row gap is not given" , ( ) => {
381393 const Test = styled . div < TestProps > `
382394 ${ grid ( 2 , 16 ) } ;
@@ -389,6 +401,20 @@ describe("styed-tidy", () => {
389401
390402 describe ( "'position' mixin" , ( ) => {
391403 it ( "sets the given position CSS attributes" , ( ) => {
404+ const Test = styled . div < TestProps > `
405+ ${ position ( "fixed" , 0 , 16 , 32 , 48 ) } ;
406+ ` ;
407+ const { getByText } = setup ( < Test > test</ Test > ) ;
408+ const test = getByText ( "test" ) ;
409+
410+ expect ( test ) . toHaveStyleRule ( "position" , "fixed" ) ;
411+ expect ( test ) . toHaveStyleRule ( "top" , "0" ) ;
412+ expect ( test ) . toHaveStyleRule ( "right" , "1rem" ) ;
413+ expect ( test ) . toHaveStyleRule ( "bottom" , "2rem" ) ;
414+ expect ( test ) . toHaveStyleRule ( "left" , "3rem" ) ;
415+ } ) ;
416+
417+ it ( "sets the given position CSS attributes from strings" , ( ) => {
392418 const Test = styled . div < TestProps > `
393419 ${ position ( "fixed" , "1rem" , "2rem" , "3rem" , "4rem" ) } ;
394420 ` ;
0 commit comments