mirror of
https://github.com/apache/cordova-plugin-screen-orientation.git
synced 2025-05-05 01:32:59 +08:00
Fixed errors in tests and changed plugin test id
This commit is contained in:
parent
68693cf017
commit
083578eaa8
@ -21,7 +21,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="cordova-plugin-device-tests"
|
id="cordova-plugin-screen-orientation-tests"
|
||||||
version="1.0.0-dev">
|
version="1.0.0-dev">
|
||||||
<name>Cordova Screen Orientation Plugin Tests</name>
|
<name>Cordova Screen Orientation Plugin Tests</name>
|
||||||
<license>Apache 2.0</license>
|
<license>Apache 2.0</license>
|
||||||
|
@ -43,8 +43,8 @@ exports.defineAutoTests = function() {
|
|||||||
describe('Screen functions', function () {
|
describe('Screen functions', function () {
|
||||||
it('should successfully lock and unlock screen orientation', function (done) {
|
it('should successfully lock and unlock screen orientation', function (done) {
|
||||||
try {
|
try {
|
||||||
window.screen.lockOrientation('landscape').then(function () {
|
window.screen.orientation.lock('landscape').then(function () {
|
||||||
expect(window.screen.unlockOrientation).not.toThrow();
|
expect(window.screen.orientation.unlock).not.toThrow();
|
||||||
done();
|
done();
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
fail('Promise was rejected: ' + err);
|
fail('Promise was rejected: ' + err);
|
||||||
@ -67,7 +67,6 @@ exports.defineAutoTests = function() {
|
|||||||
expect(window.OrientationLockType['portrait']).toBe(3);
|
expect(window.OrientationLockType['portrait']).toBe(3);
|
||||||
expect(window.OrientationLockType['landscape']).toBe(12);
|
expect(window.OrientationLockType['landscape']).toBe(12);
|
||||||
expect(window.OrientationLockType['any']).toBe(15);
|
expect(window.OrientationLockType['any']).toBe(15);
|
||||||
alert(window.screen.orientation.angle);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('Screen object should exist', function () {
|
describe('Screen object should exist', function () {
|
||||||
@ -83,10 +82,8 @@ exports.defineAutoTests = function() {
|
|||||||
expect(window.screen.orientation.lock).toEqual(jasmine.any(Function));
|
expect(window.screen.orientation.lock).toEqual(jasmine.any(Function));
|
||||||
expect(window.screen.orientation.unlock).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.type).toBeDefined();
|
||||||
expect(window.screen.orientation.angle).toBeDefined();
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user