feat: Vite + vue 3 💚 (#10047)
Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
@@ -12,16 +12,9 @@ vi.mock('shared/helpers/mitt', () => ({
|
||||
}));
|
||||
|
||||
describe('useTrack', () => {
|
||||
it('should return $track from the current instance proxy', () => {
|
||||
const mockProxy = { $track: vi.fn() };
|
||||
getCurrentInstance.mockReturnValue({ proxy: mockProxy });
|
||||
it('should return a function', () => {
|
||||
const track = useTrack();
|
||||
expect(track).toBe(mockProxy.$track);
|
||||
});
|
||||
|
||||
it('should throw an error if called outside of setup', () => {
|
||||
getCurrentInstance.mockReturnValue(null);
|
||||
expect(useTrack).toThrowError('must be called in setup');
|
||||
expect(typeof track).toBe('function');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ import {
|
||||
useMapGetter,
|
||||
} from 'dashboard/composables/store';
|
||||
import { useAlert, useTrack } from 'dashboard/composables';
|
||||
import { useI18n } from '../useI18n';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import OpenAPI from 'dashboard/api/integrations/openapi';
|
||||
|
||||
vi.mock('dashboard/composables/store');
|
||||
vi.mock('dashboard/composables');
|
||||
vi.mock('../useI18n');
|
||||
vi.mock('vue-i18n');
|
||||
vi.mock('dashboard/api/integrations/openapi');
|
||||
vi.mock('dashboard/helper/AnalyticsHelper/events', () => ({
|
||||
OPEN_AI_EVENTS: {
|
||||
|
||||
Reference in New Issue
Block a user