2016-03-25 20:03:49 +00:00
|
|
|
const assert = require('assert')
|
2017-10-27 00:55:07 +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()
|
2016-03-25 20:03:49 +00:00
|
|
|
assert.equal(typeof point.x, 'number')
|
|
|
|
assert.equal(typeof point.y, 'number')
|
|
|
|
})
|
|
|
|
})
|
2016-02-17 01:09:41 +00:00
|
|
|
|
2017-10-27 00:55:07 +00:00
|
|
|
describe('screen.getPrimaryDisplay()', () => {
|
|
|
|
it('returns a display object', () => {
|
|
|
|
const display = screen.getPrimaryDisplay()
|
2016-03-25 20:03:49 +00:00
|
|
|
assert.equal(typeof display.scaleFactor, 'number')
|
|
|
|
assert(display.size.width > 0)
|
|
|
|
assert(display.size.height > 0)
|
|
|
|
})
|
|
|
|
})
|
2017-05-30 21:26:02 +00:00
|
|
|
|
2017-10-27 00:55:07 +00:00
|
|
|
describe('screen.getMenuBarHeight()', () => {
|
2017-11-15 21:05:46 +00:00
|
|
|
before(function () {
|
|
|
|
if (process.platform !== 'darwin') {
|
|
|
|
this.skip()
|
|
|
|
}
|
|
|
|
})
|
2017-05-30 21:26:02 +00:00
|
|
|
|
2017-10-27 00:55:07 +00:00
|
|
|
it('returns an integer', () => {
|
|
|
|
const screenHeight = screen.getMenuBarHeight()
|
2017-05-30 21:26:02 +00:00
|
|
|
assert.equal(typeof screenHeight, 'number')
|
|
|
|
})
|
|
|
|
})
|
2016-03-25 20:03:49 +00:00
|
|
|
})
|