UNPKG

@react-theming/storybook-addon

Version:

Develop themes and themable components with Emotion, Styled Components, Material-UI and your custom solution

30 lines (25 loc) 713 B
import { getTheme, getThemeInfoList } from '../selectors'; import { createTheme } from '../helpers/sampleTheme'; const firstTheme = createTheme({ mainColor: 'red', name: 'red-theme', }); const secondTheme = createTheme({ mainColor: 'green', name: 'green-theme', }); const thirdTheme = createTheme({ mainColor: 'blue', name: 'blue-theme', }); const store = { themesList: [firstTheme, secondTheme, thirdTheme], currentTheme: 1, }; it('should select theme', () => { expect(getTheme(store)).toEqual(secondTheme); }); it('should select theme-names', () => { const names = ['red-theme', 'green-theme', 'blue-theme']; expect(getThemeInfoList(store).map(({ name }) => name)).toEqual(names); });