-
Notifications
You must be signed in to change notification settings - Fork 975
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These tests won’t pass, but they should.
- Loading branch information
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
var test = require('tape'); | ||
var robot = require('..'); | ||
var lastKnownPos; | ||
var lastKnownPos, currentPos; | ||
|
||
test('Get the initial mouse position.', function(t) | ||
{ | ||
t.plan(3); | ||
robot.moveMouse(0, 0); | ||
t.ok(lastKnownPos = robot.getMousePos(), 'successfully retrieved mouse position.'); | ||
t.ok(lastKnownPos.x !== undefined, 'mousepos.x is a valid value.'); | ||
t.ok(lastKnownPos.y !== undefined, 'mousepos.y is a valid value.'); | ||
}); | ||
|
||
test('Move the mouse.', function(t) | ||
{ | ||
t.plan(3); | ||
t.ok(robot.moveMouse(100, 100), 'successfully moved the mouse.'); | ||
currentPos = robot.getMousePos(); | ||
t.ok(currentPos.x !== lastKnownPos.x, 'mousepos.x has changed.'); | ||
t.ok(currentPos.y !== lastKnownPos.y, 'mousepos.y has changed.'); | ||
}); |