Skip to content

Commit

Permalink
fix: wwp config i18n mock
Browse files Browse the repository at this point in the history
  • Loading branch information
acnormun committed Oct 25, 2024
1 parent c2c61f9 commit 03d45f9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/tests/components/config/channels/whatsapp/Config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ import UnnnicSystem from '@/utils/plugins/UnnnicSystem';
import { setActivePinia } from 'pinia';
import { createTestingPinia } from '@pinia/testing';

vi.mock('vue-i18n', async (importOriginal) => {
const actual = await importOriginal();
return {
...actual,
createI18n: () => ({
t: (key) => key,
locale: 'pt-br',
}),
};
});

describe('WhatsappConfig.vue', () => {
let wrapper;
const pinia = createTestingPinia({ stubActions: false });
Expand All @@ -24,6 +35,9 @@ describe('WhatsappConfig.vue', () => {
plugins: [pinia, i18n, UnnnicSystem],
mocks: {
$t: (msg) => msg,
$i18n: {
locale: 'pt-br',
},
},
},
props: { app },
Expand All @@ -46,7 +60,7 @@ describe('WhatsappConfig.vue', () => {
const description = wrapper.find('.config-whatsapp__header__description');
expect(description.exists()).toBe(true);
expect(description.text()).toContain(
'Learn more about how to increase your daily message limit in WhatsApp here.',
'WhatsApp.config.description.text WhatsApp.config.description.link',
);
});

Expand Down

0 comments on commit 03d45f9

Please sign in to comment.