From 083578eaa87c696f55c1bc23e0ec67d755270f96 Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Wed, 25 Jan 2017 15:02:04 -0800 Subject: [PATCH] Fixed errors in tests and changed plugin test id --- tests/plugin.xml | 2 +- tests/tests.js | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/plugin.xml b/tests/plugin.xml index 5d01bad..c8d9755 100644 --- a/tests/plugin.xml +++ b/tests/plugin.xml @@ -21,7 +21,7 @@ Cordova Screen Orientation Plugin Tests Apache 2.0 diff --git a/tests/tests.js b/tests/tests.js index 08acc69..e06c2b1 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -43,8 +43,8 @@ exports.defineAutoTests = function() { describe('Screen functions', function () { it('should successfully lock and unlock screen orientation', function (done) { try { - window.screen.lockOrientation('landscape').then(function () { - expect(window.screen.unlockOrientation).not.toThrow(); + window.screen.orientation.lock('landscape').then(function () { + expect(window.screen.orientation.unlock).not.toThrow(); done(); }, function (err) { fail('Promise was rejected: ' + err); @@ -67,7 +67,6 @@ exports.defineAutoTests = function() { expect(window.OrientationLockType['portrait']).toBe(3); expect(window.OrientationLockType['landscape']).toBe(12); expect(window.OrientationLockType['any']).toBe(15); - alert(window.screen.orientation.angle); }); }); describe('Screen object should exist', function () { @@ -83,11 +82,9 @@ exports.defineAutoTests = function() { expect(window.screen.orientation.lock).toEqual(jasmine.any(Function)); expect(window.screen.orientation.unlock).toEqual(jasmine.any(Function)); }); - it(" Screenorientation object should contain properties called type and angle", function() { + it(" Screenorientation object should contain property called type", function() { expect(window.screen.orientation.type).toBeDefined(); - expect(window.screen.orientation.angle).toBeDefined(); - - }); + }); }); };