Chatwoot/app/javascript/dashboard/store/modules/specs/labels/getters.spec.js
Pranav Raj S 97ad39713b
Feature: Improve label experience (#975)
Co-authored-by: Sojan <sojan@pepalo.com>
2020-06-25 21:04:03 +05:30

30 lines
729 B
JavaScript

import { getters } from '../../labels';
import labels from './fixtures';
describe('#getters', () => {
it('getLabels', () => {
const state = { records: labels };
expect(getters.getLabels(state)).toEqual(labels);
});
it('getLabelsOnSidebar', () => {
const state = { records: labels };
expect(getters.getLabelsOnSidebar(state)).toEqual([labels[0]]);
});
it('getUIFlags', () => {
const state = {
uiFlags: {
isFetching: true,
isCreating: false,
isUpdating: false,
isDeleting: false,
},
};
expect(getters.getUIFlags(state)).toEqual({
isFetching: true,
isCreating: false,
isUpdating: false,
isDeleting: false,
});
});
});