Commit 3043db2 1 parent cac32ba commit 3043db2 Copy full SHA for 3043db2
File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
var test = require ( 'tape' ) ;
2
2
var robot = require ( '..' ) ;
3
- var lastKnownPos ;
3
+ var lastKnownPos , currentPos ;
4
4
5
5
test ( 'Get the initial mouse position.' , function ( t )
6
6
{
7
7
t . plan ( 3 ) ;
8
+ robot . moveMouse ( 0 , 0 ) ;
8
9
t . ok ( lastKnownPos = robot . getMousePos ( ) , 'successfully retrieved mouse position.' ) ;
9
10
t . ok ( lastKnownPos . x !== undefined , 'mousepos.x is a valid value.' ) ;
10
11
t . ok ( lastKnownPos . y !== undefined , 'mousepos.y is a valid value.' ) ;
11
12
} ) ;
13
+
14
+ test ( 'Move the mouse.' , function ( t )
15
+ {
16
+ t . plan ( 3 ) ;
17
+ t . ok ( robot . moveMouse ( 100 , 100 ) , 'successfully moved the mouse.' ) ;
18
+ currentPos = robot . getMousePos ( ) ;
19
+ t . ok ( currentPos . x !== lastKnownPos . x , 'mousepos.x has changed.' ) ;
20
+ t . ok ( currentPos . y !== lastKnownPos . y , 'mousepos.y has changed.' ) ;
21
+ } ) ;
You can’t perform that action at this time.
0 commit comments