Skip to content

Commit

Permalink
Add realistic variant test case
Browse files Browse the repository at this point in the history
  • Loading branch information
timhudson committed May 8, 2019
1 parent 926f9f6 commit bc70315
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/index.js
Expand Up @@ -11,6 +11,7 @@ import {
cloneFunction,
mapProps,
merge,
fontSize,
} from '../src'

const width = style({
Expand Down Expand Up @@ -289,3 +290,27 @@ test('merge deeply merges', t => {
}
})
})

test('variant can be composed', t => {
const system = compose(
variant({ key: 'typography' }),
fontSize,
color
)
const result = system({
theme: {
typography: {
primary: {
fontSize: '32px',
color: '#fff'
},
},
},
variant: 'primary',
color: '#111'
})
t.deepEqual(result, {
fontSize: '32px',
color: '#111'
})
})

0 comments on commit bc70315

Please sign in to comment.