Skip to content

Commit e5a97a1

Browse files
committed
Test that theme function resolves functions deeply
1 parent caa687a commit e5a97a1

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

__tests__/resolveConfig.test.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,16 @@ test('the theme function can use a default value if the key is missing', () => {
758758
})
759759
})
760760

761-
test('the theme function can resolve function values', () => {
761+
test.only('the theme function can resolve function values', () => {
762762
const userConfig = {
763763
theme: {
764+
textColor: theme => ({
765+
lime: 'lime',
766+
...theme('colors'),
767+
}),
764768
backgroundColor: theme => ({
765769
orange: 'orange',
766-
...theme('colors'),
770+
...theme('textColor'),
767771
}),
768772
borderColor: theme => theme('backgroundColor'),
769773
},
@@ -798,13 +802,21 @@ test('the theme function can resolve function values', () => {
798802
green: 'green',
799803
blue: 'blue',
800804
},
805+
textColor: {
806+
lime: 'lime',
807+
red: 'red',
808+
green: 'green',
809+
blue: 'blue',
810+
},
801811
backgroundColor: {
812+
lime: 'lime',
802813
orange: 'orange',
803814
red: 'red',
804815
green: 'green',
805816
blue: 'blue',
806817
},
807818
borderColor: {
819+
lime: 'lime',
808820
orange: 'orange',
809821
red: 'red',
810822
green: 'green',

0 commit comments

Comments
 (0)