Commit 2db712ef authored by Mickaël Bourgier's avatar Mickaël Bourgier
Browse files

Fix color palette wasn't overridable

parent 96535d2c
Pipeline #989 passed with stage
in 1 minute and 43 seconds
export default (colors = {}) => {
const { background = {}, ...rest } = colors;
const { background = {}, palette = {}, ...rest } = colors;
return {
text: 'rgba(0, 0, 0, 0.8)',
......@@ -14,7 +14,9 @@ export default (colors = {}) => {
warning: '#f6b74d',
danger: '#ed5655',
light: '#f0f3f8',
dark: '#555555'
dark: '#555555',
...palette
},
background: {
......
import createColors from './createColors';
describe('styles', () => {
describe('createColors', () => {
it('must allow overriding nested values', () => {
const expectedColors = createColors();
expectedColors.text = 'red';
expectedColors.palette.primary = 'red';
expectedColors.palette.custom = 'red';
expectedColors.custom = 'red';
const colors = createColors({
text: 'red',
palette: {
primary: 'red',
custom: 'red'
},
custom: 'red'
});
expect(colors).toEqual(expectedColors);
});
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment