2020-11-13 19:41:08 -05:00
|
|
|
import invokePlugin from '../util/invokePlugin'
|
|
|
|
|
import plugin from '../../src/plugins/ringColor'
|
|
|
|
|
|
|
|
|
|
test('defining color as a function', () => {
|
|
|
|
|
const config = {
|
|
|
|
|
theme: {
|
|
|
|
|
ringColor: {
|
|
|
|
|
black: ({ opacityVariable: _ }) => 'black',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
variants: {
|
|
|
|
|
ringColor: [],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { utilities } = invokePlugin(plugin(), config)
|
|
|
|
|
|
|
|
|
|
expect(utilities).toEqual([
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
'.ring-black': {
|
2020-11-16 17:45:55 +01:00
|
|
|
'--tw-ring-opacity': '1',
|
|
|
|
|
'--tw-ring-color': 'black',
|
2020-11-13 19:41:08 -05:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
[],
|
|
|
|
|
],
|
|
|
|
|
])
|
|
|
|
|
})
|