Skip to content

Commit

Permalink
fix: mock t
Browse files Browse the repository at this point in the history
  • Loading branch information
acnormun committed Oct 25, 2024
1 parent 39edf5e commit d6ac037
Show file tree
Hide file tree
Showing 27 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tests/components/AddModal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('AddModal', () => {
$router: {
replace: vi.fn(),
},
$t: (e) => e,
},
},
});
Expand Down
1 change: 1 addition & 0 deletions src/tests/components/AppGrid.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('AppGrid', () => {
],
avatar: avatarIcons.channel,
},
$t: (e) => e,
},
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/AppModal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ describe('AppModal', () => {
showRemoveModal: true,
},
},
mocks: {
$t: (e) => e,
},
});
});
it('matches snapshot', async () => {
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/BaseInput.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ describe('BaseInput', () => {
type: 'normal',
replaceRegex: null,
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
1 change: 1 addition & 0 deletions src/tests/components/Carousel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('Carousel.vue', () => {
$router: {
push: pushMock,
},
$t: (e) => e,
},
methods: {
fetchFeatured: vi.fn(),
Expand Down
1 change: 1 addition & 0 deletions src/tests/components/ColorPicker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('ColorPicker.vue', () => {
$router: {
push: pushMock,
},
$t: (e) => e,
},
methods: {
fetchFeatured: vi.fn(),
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/EmptyApps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ describe('EmptyApps.vue', () => {
global: {
plugins: [i18n, UnnnicSystem],
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/IntegrateButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ describe('IntegrateButton.vue', () => {
methods: {
unnnicCallAlert: vi.fn(),
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/LoadingButton.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ describe('LoadingButton.vue', () => {
text: 'Click Me',
isLoading: false,
},
mocks: {
$t: (e) => e,
},
});

expect(wrapper.text()).toBe('Click Me');
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/Navigator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ describe('Navigator.vue', () => {
'unnnic-icon-svg': true,
},
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/config/ConfigModal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ describe('ConfigModal.vue', () => {
global: {
plugins: [i18n, UnnnicSystem, pinia],
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/config/DynamicForm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ describe('DynamicForm.vue', () => {
props: {
inputs,
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
1 change: 1 addition & 0 deletions src/tests/components/config/channels/WWC/Config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('wwcConfig Component', () => {
plugins: [pinia, i18n, UnnnicSystem],
mocks: {
unnnic,
$t: (e) => e,
},
},
props: {
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/config/channels/facebook/Config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ describe('Config.vue', () => {
global: {
plugins: [pinia, i18n, UnnnicSystem],
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe('FacebookSetup.vue', () => {
plugins: [pinia, i18n, UnnnicSystem],
mocks: {
$router: { replace: vi.fn() },
$t: (e) => e,
},
},
props: { app: mockApp },
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/config/channels/generic/Config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ describe('GenericConfig.vue', () => {
global: {
plugins: [pinia, i18n, UnnnicSystem],
},
mocks: {
$t: (e) => e,
},
...options,
});
};
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/config/channels/instagram/Config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ describe('InstagramConfig.vue', () => {
global: {
plugins: [pinia, i18n, UnnnicSystem],
},
mocks: {
$t: (e) => e,
},
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('Config.vue', () => {
plugins: [pinia, i18n, UnnnicSystem],
mocks: {
unnnic,
$t: (e) => e,
},
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/config/channels/whatsapp/Config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ describe('WhatsappConfig.vue', () => {
plugins: [pinia, i18n, UnnnicSystem],
},
props: { app },
mocks: {
$t: (e) => e,
},
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe('WhatsAppSetup.vue', () => {
$router: {
replace: vi.fn(),
},
$t: (e) => e,
},
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/config/channels/wpp_demo/Config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ describe('Config.vue', () => {
},
},
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('wpp-demo-preview Component', () => {
plugins: [pinia, i18n, UnnnicSystem],
mocks: {
unnnic,
$t: (e) => e,
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ describe('ConnectCatalogModalContent.vue', () => {
global: {
plugins: [i18n, UnnnicSystem],
},
mocks: {
$t: (e) => e,
},
});

const title = wrapper.find('.modal__content__title');
Expand Down
1 change: 1 addition & 0 deletions src/tests/components/config/ecommerce/vtex/Setup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('VtexModal.vue', () => {
mocks: {
StepIndicator,
unnnic,
$t: (e) => e,
},
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/whatsappCatalogs/CatalogCard.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ describe('CatalogCard.vue', () => {
global: {
plugins: [i18n, UnnnicSystem],
},
mocks: {
$t: (e) => e,
},
});
});

Expand Down
1 change: 1 addition & 0 deletions src/tests/components/whatsappCatalogs/CatalogList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('CatalogList.vue', () => {
$router: {
push: vi.fn(),
},
$t: (e) => e,
},
},
});
Expand Down
3 changes: 3 additions & 0 deletions src/tests/components/whatsappCatalogs/ProductList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ describe('ProductList.vue', () => {
props: {
catalogName: 'Test Catalog',
},
mocks: {
$t: (e) => e,
},
});

await flushPromises();
Expand Down

0 comments on commit d6ac037

Please sign in to comment.