2016-03-25 20:03:49 +00:00
|
|
|
const assert = require('assert')
|
|
|
|
const screen = require('electron').screen
|
2016-01-12 02:40:23 +00:00
|
|
|
|
2016-03-25 20:03:49 +00:00
|
|
|
describe('screen module', function () {
|
|
|
|
describe('screen.getCursorScreenPoint()', function () {
|
|
|
|
it('returns a point object', function () {
|
|
|
|
var point = screen.getCursorScreenPoint()
|
|
|
|
assert.equal(typeof point.x, 'number')
|
|
|
|
assert.equal(typeof point.y, 'number')
|
|
|
|
})
|
|
|
|
})
|
2016-02-17 01:09:41 +00:00
|
|
|
|
2016-03-25 20:03:49 +00:00
|
|
|
describe('screen.getPrimaryDisplay()', function () {
|
|
|
|
it('returns a display object', function () {
|
|
|
|
var display = screen.getPrimaryDisplay()
|
|
|
|
assert.equal(typeof display.scaleFactor, 'number')
|
|
|
|
assert(display.size.width > 0)
|
|
|
|
assert(display.size.height > 0)
|
|
|
|
})
|
|
|
|
})
|
2017-05-30 21:26:02 +00:00
|
|
|
|
|
|
|
describe('screen.getMenuBarHeight()', function () {
|
|
|
|
if (process.platform !== 'darwin') {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
it('returns an integer', function () {
|
|
|
|
var screenHeight = screen.getMenuBarHeight()
|
|
|
|
assert.equal(typeof screenHeight, 'number')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2016-03-25 20:03:49 +00:00
|
|
|
})
|