Skip to content
Permalink
Browse files
[CB-3487] Fixed globalization test to include getPreferredLanguage
- added a test to check whether the getPreferredLanguage method exists
- added a test to check the language value on success
  • Loading branch information
ldeluca authored and filmaj committed Jun 20, 2013
1 parent ed3f3d0 commit 950c42e644f987927e3ad31cbb7abd46606dbf23
Showing 1 changed file with 27 additions and 0 deletions.
@@ -21,6 +21,33 @@ describe('Globalization (navigator.globalization)', function () {
expect(navigator.globalization).toBeDefined();
});

describe("getPreferredLanguage", function() {
it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getPreferredLanguage).toBeDefined();
expect(typeof navigator.globalization.getPreferredLanguage == 'function').toBe(true);
});
it("globalization.spec.3 getPreferredLanguage success callback should be called with a Properties object", function() {
var win = jasmine.createSpy().andCallFake(function(a) {
expect(a).toBeDefined();
expect(typeof a).toBe('object');
expect(a.value).toBeDefined();
expect(typeof a.value).toBe('string');
expect(a.value.length > 0).toBe(true);
}),
fail = jasmine.createSpy();

runs(function () {
navigator.globalization.getPreferredLanguage(win, fail);
});

waitsFor(function () { return win.wasCalled; }, "win never called", Tests.TEST_TIMEOUT);

runs(function () {
expect(fail).not.toHaveBeenCalled();
});
});
});

describe("getLocaleName", function() {
it("globalization.spec.1 should exist", function() {
expect(typeof navigator.globalization.getLocaleName).toBeDefined();

0 comments on commit 950c42e

Please sign in to comment.