diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-11-08 12:37:03 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-11-08 12:37:03 -0500 |
| commit | ef4f212fc1482136dba1e690ec589b315b4a377f (patch) | |
| tree | 0b7e16d72567fafcfd3e08d7c5c591ad07a63458 /StoneIsland/plugins/cordova-plugin-device/tests/tests.js | |
| parent | 5fa81da81260d65113f57a293b6256d334fe8e2d (diff) | |
build 0.7.0
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-device/tests/tests.js')
| -rw-r--r--[-rwxr-xr-x] | StoneIsland/plugins/cordova-plugin-device/tests/tests.js | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-device/tests/tests.js b/StoneIsland/plugins/cordova-plugin-device/tests/tests.js index 1f49d7e1..ac9a2810 100755..100644 --- a/StoneIsland/plugins/cordova-plugin-device/tests/tests.js +++ b/StoneIsland/plugins/cordova-plugin-device/tests/tests.js @@ -19,6 +19,8 @@ * */ +/* jshint jasmine: true */ + exports.defineAutoTests = function() { describe('Device Information (window.device)', function () { it("should exist", function() { @@ -27,18 +29,18 @@ exports.defineAutoTests = function() { it("should contain a platform specification that is a string", function() { expect(window.device.platform).toBeDefined(); - expect((new String(window.device.platform)).length > 0).toBe(true); + expect((String(window.device.platform)).length > 0).toBe(true); }); it("should contain a version specification that is a string", function() { expect(window.device.version).toBeDefined(); - expect((new String(window.device.version)).length > 0).toBe(true); + expect((String(window.device.version)).length > 0).toBe(true); }); it("should contain a UUID specification that is a string or a number", function() { expect(window.device.uuid).toBeDefined(); if (typeof window.device.uuid == 'string' || typeof window.device.uuid == 'object') { - expect((new String(window.device.uuid)).length > 0).toBe(true); + expect((String(window.device.uuid)).length > 0).toBe(true); } else { expect(window.device.uuid > 0).toBe(true); } @@ -46,12 +48,12 @@ exports.defineAutoTests = function() { it("should contain a cordova specification that is a string", function() { expect(window.device.cordova).toBeDefined(); - expect((new String(window.device.cordova)).length > 0).toBe(true); + expect((String(window.device.cordova)).length > 0).toBe(true); }); it("should depend on the presence of cordova.version string", function() { expect(window.cordova.version).toBeDefined(); - expect((new String(window.cordova.version)).length > 0).toBe(true); + expect((String(window.cordova.version)).length > 0).toBe(true); }); it("should contain device.cordova equal to cordova.version", function() { @@ -60,18 +62,30 @@ exports.defineAutoTests = function() { it("should contain a model specification that is a string", function() { expect(window.device.model).toBeDefined(); - expect((new String(window.device.model)).length > 0).toBe(true); + expect((String(window.device.model)).length > 0).toBe(true); }); it("should contain a manufacturer property that is a string", function() { expect(window.device.manufacturer).toBeDefined(); - expect((new String(window.device.manufacturer)).length > 0).toBe(true); + expect((String(window.device.manufacturer)).length > 0).toBe(true); + }); + + it("should contain an isVirtual property that is a boolean", function() { + expect(window.device.isVirtual).toBeDefined(); + expect(typeof window.device.isVirtual).toBe("boolean"); }); + + it("should contain a serial number specification that is a string", function() { + expect(window.device.serial).toBeDefined(); + expect((String(window.device.serial)).length > 0).toBe(true); + + }); + }); }; exports.defineManualTests = function(contentEl, createActionButton) { - var logMessage = function (message, color) { + var logMessage = function (message, color) { var log = document.getElementById('info'); var logLine = document.createElement('div'); if (color) { @@ -79,12 +93,12 @@ exports.defineManualTests = function(contentEl, createActionButton) { } logLine.innerHTML = message; log.appendChild(logLine); - } + }; var clearLog = function () { var log = document.getElementById('info'); log.innerHTML = ''; - } + }; var device_tests = '<h3>Press Dump Device button to get device information</h3>' + '<div id="dump_device"></div>' + |
