Chatwoot/app/javascript/widget/store/modules/specs/appConfig/mutations.spec.js
Fayaz Ahmed ef850eda0f
feat: Add the SDK method to programatically toggle live chat bubble (#4223)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2022-05-06 19:30:48 +05:30

27 lines
858 B
JavaScript

import { mutations } from '../../appConfig';
describe('#mutations', () => {
describe('#SET_REFERRER_HOST', () => {
it('sets referrer host properly', () => {
const state = { referrerHost: '' };
mutations.SET_REFERRER_HOST(state, 'www.chatwoot.com');
expect(state.referrerHost).toEqual('www.chatwoot.com');
});
});
describe('#SET_BUBBLE_VISIBILITY', () => {
it('sets bubble visibility properly', () => {
const state = { hideMessageBubble: false };
mutations.SET_BUBBLE_VISIBILITY(state, true);
expect(state.hideMessageBubble).toEqual(true);
});
});
describe('#SET_WIDGET_COLOR', () => {
it('sets widget color properly', () => {
const state = { widgetColor: '' };
mutations.SET_WIDGET_COLOR(state, '#00bcd4');
expect(state.widgetColor).toEqual('#00bcd4');
});
});
});