You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/08/07 22:26:23 UTC

[2/6] git commit: Added test to complete CB-7064, added tests that check for W3C compliance in language tags generated from PreferredLanguage and GetLocale methods

Added test to complete CB-7064, added tests that check for W3C compliance in language tags generated from PreferredLanguage and GetLocale methods


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/commit/0675cd15
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/tree/0675cd15
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/diff/0675cd15

Branch: refs/heads/master
Commit: 0675cd15c065326c42d43f575c5c65ba9e29cdf6
Parents: 9d9f5af
Author: Eric Weiterman <ew...@us.ibm.com>
Authored: Wed Jul 2 15:35:40 2014 -0400
Committer: Eric Weiterman <ew...@us.ibm.com>
Committed: Wed Jul 2 15:35:40 2014 -0400

----------------------------------------------------------------------
 test/tests.js | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/0675cd15/test/tests.js
----------------------------------------------------------------------
diff --git a/test/tests.js b/test/tests.js
index 22fda7a..3b2df25 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -52,6 +52,18 @@ exports.defineAutoTests = function () {
                 },
                 fail.bind(null, done));
             });
+            it("globalization.spec.4 getPreferredLanguage return string should have hypen", function (done) {
+                navigator.globalization.getPreferredLanguage(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);
+                    expect(a.value.indexOf('_')).toBe(-1);
+                    expect(a.value.indexOf('-')).toBeGreaterThan(0);
+                    done()
+                }, fail.bind(null, done));
+            });
         });
 
         describe("getLocaleName", function () {
@@ -69,6 +81,18 @@ exports.defineAutoTests = function () {
                     done()
                 }, fail.bind(null, done));
             });
+             it("globalization.spec.4 getLocaleName return string should have hypen", function (done) {
+                navigator.globalization.getLocaleName(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);
+                    expect(a.value.indexOf('_')).toBe(-1);
+                    expect(a.value.indexOf('-')).toBeGreaterThan(0);
+                    done()
+                }, fail.bind(null, done));
+            });
         });
 
         describe('Globalization Constants (window.Globalization)', function () {
@@ -590,5 +614,4 @@ exports.defineAutoTests = function () {
             });
         });
     });
-};
-
+};
\ No newline at end of file