Ghost/test/unit/helpers/lang.test.js
Hannah Wolfe 1bbaf65a22
Removed need for index.js in frontend/helpers
- The index.js file was actually loader code
- It was mainly used by the unit tests, which needed to be rewritten to get each helper individually
2021-10-04 16:46:01 +01:00

29 lines
680 B
JavaScript

const should = require('should');
const lang = require('../../../core/frontend/helpers/lang');
describe('{{lang}} helper', function () {
it('returns correct language tag', function () {
const locales = [
'en',
'en-gb',
'de'
];
locales.forEach((locale) => {
const context = {
hash: {},
data: {
site: {
locale
}
}
};
let rendered = lang.call({}, context);
should.exist(rendered);
rendered.string.should.equal(locale);
});
});
});