OC.getCanonicalLocale: fix tests

Signed-off-by: Claas Augner <git@caugner.de>
This commit is contained in:
Claas Augner 2018-10-24 11:17:58 +02:00 committed by GitHub
parent 00b8be60f2
commit d5e142a336
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -284,12 +284,16 @@ describe('Core base tests', function() {
});
it("Returns primary locales as is", function() {
expect(OC.getCanonicalLocale('de')).toEqual('de');
expect(OC.getCanonicalLocale('zu')).toEqual('zu');
localeStub.returns('de');
expect(OC.getCanonicalLocale()).toEqual('de');
localeStub.returns('zu');
expect(OC.getCanonicalLocale()).toEqual('zu');
});
it("Returns extended locales with hyphens", function() {
expect(OC.getCanonicalLocale('az_Cyrl_AZ')).toEqual('az-Cyrl-AZ');
expect(OC.getCanonicalLocale('de_DE')).toEqual('de-DE');
localeStub.returns('az_Cyrl_AZ');
expect(OC.getCanonicalLocale()).toEqual('az-Cyrl-AZ');
localeStub.returns('de_DE');
expect(OC.getCanonicalLocale()).toEqual('de-DE');
});
});
describe('Link functions', function() {