Skip to content

Commit

Permalink
Tests: tests for scroller view port mask position
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Jun 28, 2016
1 parent f189cfb commit cbe149e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/source/feathers/tests/ScrollerTests.as
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,32 @@ package feathers.tests
}, 25);
}

[Test]
public function testNewMaskXPositionOnHorizontalScroll():void
{
this._scroller.width = BACKGROUND_WIDTH;
this._scroller.height = BACKGROUND_HEIGHT;
this._viewPort.width = LARGE_VIEW_PORT_WIDTH;
this._scroller.validate();
this._scroller.horizontalScrollPosition = this._scroller.maxHorizontalScrollPosition / 2;
this._scroller.validate();
Assert.assertStrictlyEquals("The mask x position of the scroller's view port was not calculated correctly with horizontalScrollPosition > 0.",
this._scroller.maxHorizontalScrollPosition / 2, this._viewPort.mask.x);
}

[Test]
public function testNewMaskYPositionOnVerticalScroll():void
{
this._scroller.width = BACKGROUND_WIDTH;
this._scroller.height = BACKGROUND_HEIGHT;
this._viewPort.height = LARGE_VIEW_PORT_HEIGHT;
this._scroller.validate();
this._scroller.verticalScrollPosition = this._scroller.maxVerticalScrollPosition / 2;
this._scroller.validate();
Assert.assertStrictlyEquals("The mask y position of the scroller's view port was not calculated correctly with verticalScrollPosition > 0.",
this._scroller.maxVerticalScrollPosition / 2, this._viewPort.mask.y);
}

[Test]
public function testAutoHideBackgroundWithoutScrolling():void
{
Expand Down

0 comments on commit cbe149e

Please sign in to comment.