Skip to content

Commit

Permalink
Test that theme function resolves functions deeply
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Mar 25, 2019
1 parent caa687a commit e5a97a1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions __tests__/resolveConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,12 +758,16 @@ test('the theme function can use a default value if the key is missing', () => {
})
})

test('the theme function can resolve function values', () => {
test.only('the theme function can resolve function values', () => {
const userConfig = {
theme: {
textColor: theme => ({
lime: 'lime',
...theme('colors'),
}),
backgroundColor: theme => ({
orange: 'orange',
...theme('colors'),
...theme('textColor'),
}),
borderColor: theme => theme('backgroundColor'),
},
Expand Down Expand Up @@ -798,13 +802,21 @@ test('the theme function can resolve function values', () => {
green: 'green',
blue: 'blue',
},
textColor: {
lime: 'lime',
red: 'red',
green: 'green',
blue: 'blue',
},
backgroundColor: {
lime: 'lime',
orange: 'orange',
red: 'red',
green: 'green',
blue: 'blue',
},
borderColor: {
lime: 'lime',
orange: 'orange',
red: 'red',
green: 'green',
Expand Down

0 comments on commit e5a97a1

Please sign in to comment.