electron/spec/api-screen-spec.js

22 lines
659 B
JavaScript
Raw Normal View History

2016-03-25 20:03:49 +00:00
const assert = require('assert')
2018-09-13 16:10:51 +00:00
const { screen } = require('electron')
2016-01-12 02:40:23 +00:00
2017-10-27 00:55:07 +00:00
describe('screen module', () => {
describe('screen.getCursorScreenPoint()', () => {
it('returns a point object', () => {
const point = screen.getCursorScreenPoint()
2018-09-13 16:10:51 +00:00
assert.strictEqual(typeof point.x, 'number')
assert.strictEqual(typeof point.y, 'number')
2016-03-25 20:03:49 +00:00
})
})
2017-10-27 00:55:07 +00:00
describe('screen.getPrimaryDisplay()', () => {
it('returns a display object', () => {
const display = screen.getPrimaryDisplay()
2018-09-13 16:10:51 +00:00
assert.strictEqual(typeof display.scaleFactor, 'number')
2016-03-25 20:03:49 +00:00
assert(display.size.width > 0)
assert(display.size.height > 0)
})
})
})