@@ -1822,3 +1822,92 @@ describe('queries: @media', () => {
18221822 expect ( props . style . color ) . toBe ( 'white' ) ;
18231823 } ) ;
18241824} ) ;
1825+
1826+ describe ( 'css.types.*' , ( ) => {
1827+ test ( 'types.angle' , ( ) => {
1828+ const tokens = css . defineVars ( {
1829+ angle : css . types . angle ( '40deg' )
1830+ } ) ;
1831+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1832+ } ) ;
1833+
1834+ test ( 'types.color' , ( ) => {
1835+ const tokens = css . defineVars ( {
1836+ color : css . types . color ( {
1837+ default : 'blue' ,
1838+ '@media (prefers-color-scheme: dark)' : 'lightblue'
1839+ } )
1840+ } ) ;
1841+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1842+ } ) ;
1843+
1844+ test ( 'types.image' , ( ) => {
1845+ const tokens = css . defineVars ( {
1846+ image : css . types . image ( './jpg' )
1847+ } ) ;
1848+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1849+ } ) ;
1850+
1851+ test ( 'types.integer' , ( ) => {
1852+ const tokens = css . defineVars ( {
1853+ integer : css . types . integer ( 4 )
1854+ } ) ;
1855+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1856+ } ) ;
1857+
1858+ test ( 'types.length' , ( ) => {
1859+ const tokens = css . defineVars ( {
1860+ length : css . types . length ( '4px' )
1861+ } ) ;
1862+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1863+ } ) ;
1864+
1865+ test ( 'types.lengthPercentage' , ( ) => {
1866+ const tokens = css . defineVars ( {
1867+ lengthPercentage : css . types . lengthPercentage ( '100%' )
1868+ } ) ;
1869+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1870+ } ) ;
1871+
1872+ test ( 'types.number' , ( ) => {
1873+ const tokens = css . defineVars ( {
1874+ number : css . types . number ( 4.4 )
1875+ } ) ;
1876+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1877+ } ) ;
1878+
1879+ test ( 'types.percentage' , ( ) => {
1880+ const tokens = css . defineVars ( {
1881+ percentage : css . types . percentage ( '100%' )
1882+ } ) ;
1883+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1884+ } ) ;
1885+
1886+ test ( 'types.resolution' , ( ) => {
1887+ const tokens = css . defineVars ( {
1888+ resolution : css . types . resolution ( '96dpi' )
1889+ } ) ;
1890+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1891+ } ) ;
1892+
1893+ test ( 'types.time' , ( ) => {
1894+ const tokens = css . defineVars ( {
1895+ time : css . types . time ( '1s' )
1896+ } ) ;
1897+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1898+ } ) ;
1899+
1900+ test ( 'types.transformFunction' , ( ) => {
1901+ const tokens = css . defineVars ( {
1902+ transformFunction : css . types . transformFunction ( 'translateX(10px)' )
1903+ } ) ;
1904+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1905+ } ) ;
1906+
1907+ test ( 'types.url' , ( ) => {
1908+ const tokens = css . defineVars ( {
1909+ url : css . types . url ( 'https://foobar.com' )
1910+ } ) ;
1911+ expect ( tokens ) . toMatchSnapshot ( 'tokens' ) ;
1912+ } ) ;
1913+ } ) ;
0 commit comments