electron/spec/api-screen-spec.js

22 lines
679 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() {
2016-02-17 01:39:11 +00:00
it('returns a point object', function() {
var point = screen.getCursorScreenPoint();
2016-01-12 02:40:23 +00:00
assert.equal(typeof point.x, 'number');
2016-02-17 01:39:11 +00:00
assert.equal(typeof point.y, 'number');
2016-01-12 02:40:23 +00:00
});
});
2016-02-17 01:39:11 +00:00
describe('screen.getPrimaryDisplay()', function() {
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);
2016-02-17 01:39:11 +00:00
assert(display.size.height > 0);
2016-01-12 02:40:23 +00:00
});
});
});