Skip to content

Commit

Permalink
Merge pull request #1 from chrismayer/cm/wljrodrigues-master
Browse files Browse the repository at this point in the history
Fix Locale tests for new Portuguese translation
  • Loading branch information
wljrodrigues authored Apr 25, 2024
2 parents a66a50f + abbe7cb commit fcb01e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('localeswitcher/LocaleSwitcher.vue', () => {
it('has correct default data', () => {
expect(typeof LocaleSwitcher.data).to.equal('function');
expect(vm.lang).to.be.an('object');
expect(Object.keys(vm.lang).length).to.eql(2);
expect(Object.keys(vm.lang).length).to.eql(3);
expect(vm.lang.en).to.eql('English');
expect(vm.lang.de).to.eql('Deutsch');
expect(vm.lang.pt).to.eql('Portugues');
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/specs/util/Locale.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const appConfig = {
de: 'Deutsch',
pt: 'Portugues'
},
fallback: 'pt'
fallback: 'de'
}
};

Expand All @@ -29,11 +29,10 @@ describe('LocaleUtil', () => {
it('getSupportedLanguages returns correct languages', () => {
const supported = LocaleUtil.getSupportedLanguages(appConfig);
expect(supported).to.be.an('object');
expect(Object.keys(supported).length).to.eql(2);
expect(Object.keys(supported).length).to.eql(3);
expect(supported.en).to.eql('English');
expect(supported.de).to.eql('Deutsch');
expect(supported.pt).to.eql('Portugues');

});

it('getSupportedLanguages returns correct fallback language when lang is unconfigured', () => {
Expand All @@ -55,12 +54,13 @@ describe('LocaleUtil', () => {

it('isLanguageSupported returns correct results', () => {
const enSupported = LocaleUtil.isLanguageSupported('en', appConfig);
const ptSupported = LocaleUtil.isLanguageSupported('pt', appConfig);
const deSupported = LocaleUtil.isLanguageSupported('de', appConfig);
const frSupported = LocaleUtil.isLanguageSupported('fr', appConfig);
const ptSupported = LocaleUtil.isLanguageSupported('pt', appConfig);
expect(enSupported).to.be.true;
expect(deSupported).to.be.true;
expect(frSupported).to.be.false;
expect(ptSupported).to.be.true;
});

it('isLanguageSupported returns correct results when lang is unconfigured', () => {
Expand Down

0 comments on commit fcb01e9

Please sign in to comment.