api-screen-spec.js 639 B

12345678910111213141516171819202122
  1. const assert = require('assert')
  2. const {screen} = require('electron')
  3. describe('screen module', () => {
  4. describe('screen.getCursorScreenPoint()', () => {
  5. it('returns a point object', () => {
  6. const point = screen.getCursorScreenPoint()
  7. assert.equal(typeof point.x, 'number')
  8. assert.equal(typeof point.y, 'number')
  9. })
  10. })
  11. describe('screen.getPrimaryDisplay()', () => {
  12. it('returns a display object', () => {
  13. const display = screen.getPrimaryDisplay()
  14. assert.equal(typeof display.scaleFactor, 'number')
  15. assert(display.size.width > 0)
  16. assert(display.size.height > 0)
  17. })
  18. })
  19. })