mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Test custom core plugin config overrides default core plugin config
This commit is contained in:
parent
4afb9e45e6
commit
4c2be2ac2c
@ -122,3 +122,52 @@ test('plugins are configured with their default configuration if no custom confi
|
||||
{ plugin: 'backgroundPosition', options: {} },
|
||||
])
|
||||
})
|
||||
|
||||
test('custom plugin configuration overrides default plugin configuration', () => {
|
||||
const plugins = {
|
||||
fontSize: options => {
|
||||
return {
|
||||
plugin: 'fontSize',
|
||||
options,
|
||||
}
|
||||
},
|
||||
display: options => {
|
||||
return {
|
||||
plugin: 'display',
|
||||
options,
|
||||
}
|
||||
},
|
||||
backgroundPosition: options => {
|
||||
return {
|
||||
plugin: 'backgroundPosition',
|
||||
options,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
const configuredPlugins = configurePlugins(plugins, {
|
||||
fontSize: {
|
||||
variants: ['responsive', 'hover'],
|
||||
values: { '12': '12px', '14': '14px', '16': '16px' },
|
||||
},
|
||||
display: { variants: ['responsive'] },
|
||||
backgroundPosition: {},
|
||||
}, {
|
||||
fontSize: {
|
||||
variants: ['focus', 'active'],
|
||||
values: { 'sm': '.75rem', 'md': '1rem', 'lg': '1.5rem' },
|
||||
},
|
||||
})
|
||||
|
||||
expect(configuredPlugins).toEqual([
|
||||
{
|
||||
plugin: 'fontSize',
|
||||
options: {
|
||||
variants: ['responsive', 'hover'],
|
||||
values: { '12': '12px', '14': '14px', '16': '16px' },
|
||||
},
|
||||
},
|
||||
{ plugin: 'display', options: { variants: ['responsive'] } },
|
||||
{ plugin: 'backgroundPosition', options: {} },
|
||||
])
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user