mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
95d27e7f58
- 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
29 lines
683 B
JavaScript
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);
|
|
});
|
|
});
|
|
});
|