electron/spec/api-screen-spec.js

22 lines
714 B
JavaScript
Raw Normal View History

2016-02-17 00:46:49 +00:00
const assert = require('assert');
const screen = require('electron').screen;
2016-01-12 02:40:23 +00:00
describe('screen module', function() {
describe('screen.getCursorScreenPoint()', function() {
return it('returns a point object', function() {
var point = screen.getCursorScreenPoint();
2016-01-12 02:40:23 +00:00
assert.equal(typeof point.x, 'number');
return assert.equal(typeof point.y, 'number');
});
});
2016-01-12 02:40:23 +00:00
return describe('screen.getPrimaryDisplay()', function() {
return it('returns a display object', function() {
var display = screen.getPrimaryDisplay();
2016-01-12 02:40:23 +00:00
assert.equal(typeof display.scaleFactor, 'number');
assert(display.size.width > 0);
return assert(display.size.height > 0);
});
});
});