Ghost/test/unit/frontend/helpers/lang.test.js
Hannah Wolfe 95d27e7f58
Moved frontend unit tests into their own folder
- this is a small part of a bit of cleanup of our test files
- the goal is to make the existing tests clearer with a view to making it easier to write more tests
- this makes the test structure follow the codebase structure more closely
- eventually we will colocate the frontend tests with the frontend code
2021-10-06 11:58:29 +01:00

29 lines
683 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);
});
});
});