chore: Add action to set dark mode from the react-native-widget (#7167)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -24,4 +24,11 @@ describe('#actions', () => {
|
||||
expect(commit.mock.calls).toEqual([['SET_WIDGET_COLOR', '#eaeaea']]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setColorScheme', () => {
|
||||
it('creates actions for dark mode properly', () => {
|
||||
actions.setColorScheme({ commit }, 'dark');
|
||||
expect(commit.mock.calls).toEqual([['SET_DARK_MODE', 'dark']]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -24,4 +24,12 @@ describe('#mutations', () => {
|
||||
expect(state.widgetColor).toEqual('#00bcd4');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#SET_COLOR_SCHEME', () => {
|
||||
it('sets dark mode properly', () => {
|
||||
const state = { darkMode: 'light' };
|
||||
mutations.SET_COLOR_SCHEME(state, 'dark');
|
||||
expect(state.darkMode).toEqual('dark');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user