fix(captain): keep responding to pending conversations on audience or schedule drift

This commit is contained in:
Pranav
2026-07-16 20:38:27 -07:00
parent 304777e728
commit 5029b25d5c
3 changed files with 102 additions and 23 deletions
@@ -1,11 +1,11 @@
import { mount } from '@vue/test-utils';
import { nextTick } from 'vue';
import { createStore } from 'vuex';
import { useRoute } from 'vue-router';
import InboxChannelsDialog from '../../inbox-setup/InboxChannelsDialog.vue';
vi.mock('vue-i18n', () => ({ useI18n: () => ({ t: key => key }) }));
vi.mock('dashboard/composables/store', () => ({
useMapGetter: () => ({ value: {} }),
}));
vi.mock('vue-router');
vi.mock('../../inbox-setup/useChannelConnect', () => ({
useChannelConnect: () => ({
connectViaOAuth: vi.fn(),
@@ -13,10 +13,30 @@ vi.mock('../../inbox-setup/useChannelConnect', () => ({
}),
}));
const store = createStore({
modules: {
globalConfig: {
namespaced: true,
getters: {
get: () => ({}),
isOnChatwootCloud: () => false,
},
},
accounts: {
namespaced: true,
getters: {
getAccount: () => () => ({ id: 1, features: {} }),
isFeatureEnabledonAccount: () => () => false,
},
},
},
});
const mountDialog = () =>
mount(InboxChannelsDialog, {
props: { inboxes: [] },
global: {
plugins: [store],
stubs: {
Dialog: {
template: '<div><slot /></div>',
@@ -31,6 +51,10 @@ const mountDialog = () =>
});
describe('InboxChannelsDialog Facebook gating', () => {
beforeEach(() => {
useRoute.mockReturnValue({ params: { accountId: '1' } });
});
afterEach(() => {
delete window.chatwootConfig;
});