You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							35 lines
						
					
					
						
							615 B
						
					
					
				
			
		
		
	
	
							35 lines
						
					
					
						
							615 B
						
					
					
				| import layout from '../src'
 | |
| 
 | |
| test('returns layout styles', () => {
 | |
|   const style = layout({
 | |
|     width: [ 1, 1/2, 1/4 ],
 | |
|     minHeight: 32,
 | |
|     maxWidth: 768,
 | |
|   })
 | |
|   expect(style).toEqual({
 | |
|     width: '100%',
 | |
|     maxWidth: 768,
 | |
|     minHeight: 32,
 | |
|     '@media screen and (min-width: 40em)': {
 | |
|       width: '50%',
 | |
|     },
 | |
|     '@media screen and (min-width: 52em)': {
 | |
|       width: '25%',
 | |
|     },
 | |
|   })
 | |
| })
 | |
| 
 | |
| test('returns 0 from theme.sizes', () => {
 | |
|   const style = layout({
 | |
|     theme: {
 | |
|       sizes: [ 24, 48, 96 ],
 | |
|     },
 | |
|     width: 0,
 | |
|     height: 0,
 | |
|   })
 | |
|   expect(style).toEqual({
 | |
|     width: 24,
 | |
|     height: 24,
 | |
|   })
 | |
| })
 |