Files
wekan/server/lib/tests/languageNames.tests.js
T
Lauri OjansivuandClaude Opus 4.8 d4ee63eb15 Updated ChangeLog: 12 more open-Bug fixes; register tests; fix #3265 language test
Add Upcoming 'fixes the following bugs' bullets (with commit links) for the latest
batch of open Bug fixes (#3289/#4172/#5457, #5398/#5399/#5537/#5546, #5408, #5382,
#5582, #5330, #2091), register their unit tests in the loaders, and rewrite the
#3265 Latvian-language regression test to import the languages module directly
(the previous fs.readFileSync approach failed in the Meteor test bundle). Latvian
native name 'Latviešu valoda' was already correct, so #3265 needed no code change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 19:20:22 +03:00

32 lines
1.1 KiB
JavaScript

/* eslint-env mocha */
// Regression test for issue #3265:
// "Incorrect namestring for Latvian language in the menu".
//
// The supported-language list lives in imports/i18n/languages.js as a default
// export. Each entry's `load` is a lazy `() => import(...)`, so importing the
// module does NOT trigger any JSON load — the entry objects (code/tag/name) are
// available directly. We assert the Latvian entry has code "lv" and the correct
// native name "Latviešu valoda".
import { expect } from 'chai';
import languages from '/imports/i18n/languages';
// Pure helper: the correct native name for Latvian (issue #3265).
export function latvianName() {
return 'Latviešu valoda';
}
describe('language names (#3265)', function() {
it('pure helper returns the correct Latvian native name', function() {
expect(latvianName()).to.equal('Latviešu valoda');
});
it('has a Latvian entry with code "lv"', function() {
expect(languages).to.have.property('lv');
expect(languages.lv.code).to.equal('lv');
});
it('shows the correct native name for Latvian', function() {
expect(languages.lv.name).to.equal(latvianName());
});
});