File tree Expand file tree Collapse file tree 3 files changed +26
-2
lines changed
Expand file tree Collapse file tree 3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1- import merge from 'lodash.merge' ;
21import defaultTheme from './default' ;
2+ import { createTheme } from '../utils/themes' ;
33
4- const roliTheme = merge ( { } , defaultTheme , {
4+ const roliTheme = createTheme ( defaultTheme , {
55 timeline : {
66 backgroundColor : '#0C1734' ,
77 a : { color : 'yellow' } ,
Original file line number Diff line number Diff line change 1+ import merge from 'lodash.merge' ;
2+
3+ export function createTheme ( baseTheme , newTheme ) {
4+ return merge ( { } , baseTheme , newTheme ) ;
5+ }
Original file line number Diff line number Diff line change 1+ import { createTheme } from './themes' ;
2+
3+ test ( 'createTheme creates a theme' , ( ) => {
4+ const baseTheme = { timelinex : { backgroundColor : '#fff' } } ;
5+ const newTheme = createTheme ( baseTheme , {
6+ timelineTrack : { backgroundColor : '#000' } ,
7+ } ) ;
8+
9+ const expected = {
10+ timeline : {
11+ backgroundColor : '#fff' ,
12+ } ,
13+ timelineTrack : {
14+ backgroundColor : '#000' ,
15+ } ,
16+ } ;
17+
18+ expect ( newTheme ) . toEqual ( expected ) ;
19+ } ) ;
You can’t perform that action at this time.
0 commit comments