Chatwoot/app/javascript/dashboard/store/modules/specs/attributes/getters.spec.js
2021-09-08 09:37:58 +05:30

30 lines
754 B
JavaScript

import { getters } from '../../attributes';
import attributesList from './fixtures';
describe('#getters', () => {
it('getAttributesByModel', () => {
const state = { records: attributesList };
expect(getters.getAttributesByModel(state)(1)).toEqual([
{
attribute_display_name: 'Language one',
attribute_display_type: 2,
attribute_description: 'The conversation language one',
attribute_key: 'language_one',
attribute_model: 1,
},
]);
});
it('getUIFlags', () => {
const state = {
uiFlags: {
isFetching: true,
isCreating: false,
},
};
expect(getters.getUIFlags(state)).toEqual({
isFetching: true,
isCreating: false,
});
});
});