Skip to content

Commit 9fb85d4

Browse files
committed
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
1 parent 64ec42c commit 9fb85d4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/jasmine/assets/mouse_event.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
var Lib = require('../../../src/lib');
22

33
module.exports = function(type, x, y, opts) {
4+
var visibility = document.visibilityState;
5+
if(visibility && visibility !== 'visible') {
6+
throw new Error('document.visibilityState = "' + visibility + '" - Please make the window visible.');
7+
}
8+
49
var fullOpts = {
510
bubbles: true,
611
clientX: x,

0 commit comments

Comments
 (0)