mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-17 02:29:10 +00:00
absolutely massive typescript porting time
This commit is contained in:
parent
01f238f515
commit
30d08a630f
159 changed files with 2563 additions and 3861 deletions
42
packages/roleypoly-ui/kit/__test__/media.test.tsx
Normal file
42
packages/roleypoly-ui/kit/__test__/media.test.tsx
Normal file
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* @jest-environment jsdom
|
||||
*/
|
||||
/* eslint-env jest */
|
||||
import MediaQuery, { xs, sm, md, lg, xl } from '../media'
|
||||
|
||||
describe('MediaQuery', () => {
|
||||
it('outputs media queries', () => {
|
||||
const mq = MediaQuery({
|
||||
xs: 'font-size: 0.5em;',
|
||||
sm: 'font-size: 1em;',
|
||||
md: 'font-size: 1.5em;',
|
||||
lg: 'font-size: 2em;',
|
||||
xl: 'font-size: 2.5em;'
|
||||
})
|
||||
|
||||
expect(mq).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
|
||||
describe('mediaTemplateLiteral', () => {
|
||||
it('renders how we expect', () => {
|
||||
// this is a weird fixture because of how we render MediaQuery for testing
|
||||
const mq = `${xs`font-size: 0.5em;`}
|
||||
${sm`font-size: 1em;`}
|
||||
${md`font-size: 1.5em;`}
|
||||
${lg`font-size: 2em;`}
|
||||
${xl`font-size: 2.5em;`}`
|
||||
|
||||
expect(mq).toMatchSnapshot()
|
||||
|
||||
const mq2 = MediaQuery({//
|
||||
xs: 'font-size: 0.5em;',
|
||||
sm: 'font-size: 1em;',
|
||||
md: 'font-size: 1.5em;',
|
||||
lg: 'font-size: 2em;',
|
||||
xl: 'font-size: 2.5em;'
|
||||
})
|
||||
|
||||
expect(mq).toEqual(mq2)
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue