chore: Add an indicator for incoming emails (#1112)

This commit is contained in:
Pranav Raj S
2020-08-01 20:56:47 +05:30
committed by GitHub
parent 6d4cfcceba
commit 5e5f34bedc
15 changed files with 207 additions and 219 deletions

View File

@@ -0,0 +1,3 @@
export const CONTENT_TYPES = {
INCOMING_EMAIL: 'incoming_email',
};

View File

@@ -0,0 +1,9 @@
import { CONTENT_TYPES } from '../constants/contentType';
export default {
computed: {
isEmailContentType() {
return this.contentType === CONTENT_TYPES.INCOMING_EMAIL;
},
},
};

View File

@@ -0,0 +1,32 @@
import { shallowMount } from '@vue/test-utils';
import contentTypeMixin from '../contentTypeMixin';
describe('contentTypeMixin', () => {
it('returns true if contentType is incoming_email', () => {
const Component = {
render() {},
mixins: [contentTypeMixin],
computed: {
contentType() {
return 'incoming_email';
},
},
};
const wrapper = shallowMount(Component);
expect(wrapper.vm.isEmailContentType).toBe(true);
});
it('returns false if contentType is not incoming_email', () => {
const Component = {
render() {},
mixins: [contentTypeMixin],
computed: {
contentType() {
return 'input_select';
},
},
};
const wrapper = shallowMount(Component);
expect(wrapper.vm.isEmailContentType).toBe(false);
});
});