From 9fb85d42986dd847735a1128d002e1e4bea00a95 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Thu, 8 Mar 2018 13:16:52 -0500 Subject: [PATCH] throw an error if the test window is hidden when we try to emit a mouse event, which the browser may ignore if it's hidden --- test/jasmine/assets/mouse_event.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/jasmine/assets/mouse_event.js b/test/jasmine/assets/mouse_event.js index 311842902f3..f8316c5c564 100644 --- a/test/jasmine/assets/mouse_event.js +++ b/test/jasmine/assets/mouse_event.js @@ -1,6 +1,11 @@ var Lib = require('../../../src/lib'); module.exports = function(type, x, y, opts) { + var visibility = document.visibilityState; + if(visibility && visibility !== 'visible') { + throw new Error('document.visibilityState = "' + visibility + '" - Please make the window visible.'); + } + var fullOpts = { bubbles: true, clientX: x,