diff --git a/app/javascript/dashboard/components/widgets/conversation/Message.vue b/app/javascript/dashboard/components/widgets/conversation/Message.vue index 54167db71..0de7b5193 100644 --- a/app/javascript/dashboard/components/widgets/conversation/Message.vue +++ b/app/javascript/dashboard/components/widgets/conversation/Message.vue @@ -158,7 +158,7 @@ import InstagramStory from './bubble/InstagramStory.vue'; import InstagramStoryReply from './bubble/InstagramStoryReply.vue'; import Spinner from 'shared/components/Spinner.vue'; import alertMixin from 'shared/mixins/alertMixin'; -import contentTypeMixin from 'shared/mixins/contentTypeMixin'; +import { CONTENT_TYPES } from 'shared/constants/contentType'; import { MESSAGE_TYPE, MESSAGE_STATUS } from 'shared/constants/messages'; import { generateBotMessageContent } from './helpers/botMessageContentHelper'; import { BUS_EVENTS } from 'shared/constants/busEvents'; @@ -184,7 +184,7 @@ export default { InstagramStoryReply, Spinner, }, - mixins: [alertMixin, messageFormatterMixin, contentTypeMixin], + mixins: [alertMixin, messageFormatterMixin], props: { data: { type: Object, @@ -482,6 +482,9 @@ export default { } return ''; }, + isEmailContentType() { + return this.contentType === CONTENT_TYPES.INCOMING_EMAIL; + }, }, watch: { data() { diff --git a/app/javascript/shared/mixins/contentTypeMixin.js b/app/javascript/shared/mixins/contentTypeMixin.js deleted file mode 100644 index 149d7b7b7..000000000 --- a/app/javascript/shared/mixins/contentTypeMixin.js +++ /dev/null @@ -1,9 +0,0 @@ -import { CONTENT_TYPES } from '../constants/contentType'; - -export default { - computed: { - isEmailContentType() { - return this.contentType === CONTENT_TYPES.INCOMING_EMAIL; - }, - }, -}; diff --git a/app/javascript/shared/mixins/specs/contentTypeMixin.spec.js b/app/javascript/shared/mixins/specs/contentTypeMixin.spec.js deleted file mode 100644 index a523c0513..000000000 --- a/app/javascript/shared/mixins/specs/contentTypeMixin.spec.js +++ /dev/null @@ -1,32 +0,0 @@ -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); - }); -});