summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/cordova-plugin-device/tests
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-device/tests')
-rw-r--r--[-rwxr-xr-x]StoneIsland/plugins/cordova-plugin-device/tests/plugin.xml2
-rw-r--r--[-rwxr-xr-x]StoneIsland/plugins/cordova-plugin-device/tests/tests.js34
2 files changed, 25 insertions, 11 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-device/tests/plugin.xml b/StoneIsland/plugins/cordova-plugin-device/tests/plugin.xml
index bcca190e..ad4433c9 100755..100644
--- a/StoneIsland/plugins/cordova-plugin-device/tests/plugin.xml
+++ b/StoneIsland/plugins/cordova-plugin-device/tests/plugin.xml
@@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-device-tests"
- version="1.0.1">
+ version="1.1.3">
<name>Cordova Device Plugin Tests</name>
<license>Apache 2.0</license>
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>' +