Skip to content

Commit

Permalink
horizontal scroll test.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Feb 25, 2018
1 parent 07d6f0e commit 0ebd39e
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test/integration/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Integration/Mouse', () => {
robot.mouseClick();
});

it('scrolls', done => {
it('scrolls vertically', done => {
target.once('scroll', element => {
/**
* TODO: This is gross! The scroll distance is different for each OS. I want
Expand All @@ -64,4 +64,32 @@ describe('Integration/Mouse', () => {
robot.mouseClick();
robot.scrollMouse(0, -10);
});

it('scrolls horizontally', done => {
target.once('scroll', element => {
/**
* TODO: This is gross! The scroll distance is different for each OS. I want
* to look into this further, but at least these numbers are consistent.
*/
var expectedScroll;
switch(os.platform()) {
case 'linux':
expectedScroll = 530;
break;
case 'win32':
expectedScroll = 8;
break;
default:
expectedScroll = 10;
}
expect(element.id).toEqual('textarea_1');
expect(element.scroll_x).toEqual(expectedScroll);
done();
});

var textarea_1 = elements.textarea_1;
robot.moveMouse(textarea_1.x, textarea_1.y);
robot.mouseClick();
robot.scrollMouse(-10, 0);
});
});

0 comments on commit 0ebd39e

Please sign in to comment.