strapi-plugin-i18n
Version:
This plugin enables to create, to read and to update content in different languages, both from the Admin Panel and from the API
27 lines (22 loc) • 548 B
JavaScript
;
const { listIsoLocales } = require('../iso-locales');
describe('ISO locales', () => {
test('listIsoLocales', () => {
const isoLocales = [{ code: 'af', name: 'Afrikaans (af)' }];
const getIsoLocales = jest.fn(() => isoLocales);
global.strapi = {
plugins: {
i18n: {
services: {
'iso-locales': {
getIsoLocales,
},
},
},
},
};
const ctx = {};
listIsoLocales(ctx);
expect(ctx.body).toMatchObject(isoLocales);
});
});