Chatwoot/app/javascript/widget/store/modules/specs/appConfig/actions.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
822 B
JavaScript

import { actions } from '../../appConfig';
const commit = jest.fn();
describe('#actions', () => {
describe('#setReferrerHost', () => {
it('creates actions properly', () => {
actions.setReferrerHost({ commit }, 'www.chatwoot.com');
expect(commit.mock.calls).toEqual([
['SET_REFERRER_HOST', 'www.chatwoot.com'],
]);
});
});
describe('#setBubbleVisibility', () => {
it('creates actions properly', () => {
actions.setBubbleVisibility({ commit }, false);
expect(commit.mock.calls).toEqual([['SET_BUBBLE_VISIBILITY', false]]);
});
});
describe('#setWidgetColor', () => {
it('creates actions properly', () => {
actions.setWidgetColor({ commit }, '#eaeaea');
expect(commit.mock.calls).toEqual([['SET_WIDGET_COLOR', '#eaeaea']]);
});
});
});