mirror of
https://github.com/apache/cordova-plugin-screen-orientation.git
synced 2025-02-24 00:52:50 +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"
|
||||
xmlns:rim="http://www.blackberry.com/ns/widgets"
|
||||
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">
|
||||
<name>Cordova Screen Orientation Plugin Tests</name>
|
||||
<license>Apache 2.0</license>
|
||||
|
@ -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();
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user