chore: fix circleci on vite build (#10214)

- Switch to pnpm based build
- Switch circleci from docker to machine to have more memory
- Fix frontend and backend tests

Fixes
https://linear.app/chatwoot/issue/CW-3610/fix-circle-ci-for-vite-build
---------

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: Pranav <pranavrajs@gmail.com>
Co-authored-by: Pranav <pranav@chatwoot.com>
This commit is contained in:
Vishnu Narayanan
2024-10-07 15:27:41 +05:30
committed by GitHub
parent 0677d8763d
commit ee02923ace
54 changed files with 1130 additions and 1334 deletions

View File

@@ -1,6 +1,7 @@
import { createWrapper } from '@vue/test-utils';
import { shallowMount } from '@vue/test-utils';
import configMixin from '../configMixin';
import Vue from 'vue';
import { reactive } from 'vue';
const preChatFields = [
{
label: 'Email Id',
@@ -19,6 +20,7 @@ const preChatFields = [
enabled: true,
},
];
global.chatwootWebChannel = {
avatarUrl: 'https://test.url',
hasAConnectedAgentBot: 'AgentBot',
@@ -34,14 +36,16 @@ global.chatwootWebChannel = {
describe('configMixin', () => {
test('returns config', () => {
const Component = {
render() {},
title: 'TestComponent',
const wrapper = shallowMount({
mixins: [configMixin],
};
const Constructor = Vue.extend(Component);
const vm = new Constructor().$mount();
const wrapper = createWrapper(vm);
data() {
return {
channelConfig: reactive(global.chatwootWebChannel),
};
},
template: '<div />', // Render a simple div as the template
});
expect(wrapper.vm.hasEmojiPickerEnabled).toBe(true);
expect(wrapper.vm.hasEndConversationEnabled).toBe(true);
expect(wrapper.vm.hasAttachmentsEnabled).toBe(true);
@@ -68,7 +72,7 @@ describe('configMixin', () => {
preChatMessage: '',
preChatFields: preChatFields,
});
expect(wrapper.vm.preChatFormEnabled).toEqual(true);
expect(wrapper.vm.shouldShowPreChatForm).toEqual(true);
expect(wrapper.vm.preChatFormEnabled).toBe(true);
expect(wrapper.vm.shouldShowPreChatForm).toBe(true);
});
});