electron/spec/api-screen-spec.js

34 lines
943 B
JavaScript
Raw Normal View History

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-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)
})
})
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
})