From ef4f212fc1482136dba1e690ec589b315b4a377f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 8 Nov 2016 12:37:03 -0500 Subject: build 0.7.0 --- .../plugins/cordova-plugin-device/tests/tests.js | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) mode change 100755 => 100644 StoneIsland/plugins/cordova-plugin-device/tests/tests.js (limited to 'StoneIsland/plugins/cordova-plugin-device/tests/tests.js') diff --git a/StoneIsland/plugins/cordova-plugin-device/tests/tests.js b/StoneIsland/plugins/cordova-plugin-device/tests/tests.js old mode 100755 new mode 100644 index 1f49d7e1..ac9a2810 --- 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 = '

Press Dump Device button to get device information

' + '
' + -- cgit v1.2.3-70-g09d2