Commit dbb7c2e8 authored by Adam Barth's avatar Adam Barth

Add a scrolling test now that it passes

We fixed this issue a different way but the test is still valuable.
parent 0b5b3451
......@@ -136,4 +136,23 @@ void main() {
expect(log, equals(['scrollstart', 'scrollend']));
});
});
test('fling up ends', () {
testWidgets((WidgetTester tester) {
GlobalKey<ScrollableState<Scrollable>> scrollKey = new GlobalKey<ScrollableState<Scrollable>>();
List<String> log = <String>[];
tester.pumpWidget(_buildScroller(key: scrollKey, log: log));
expect(log, equals([]));
tester.flingFrom(new Point(100.0, 100.0), new Offset(50.0, 50.0), 500.0);
tester.pump(new Duration(seconds: 1));
tester.pump(new Duration(seconds: 1));
tester.pump(new Duration(seconds: 1));
expect(log.first, equals('scrollstart'));
expect(log.last, equals('scrollend'));
log.removeWhere((String value) => value == 'scroll');
expect(log.length, equals(2));
expect(scrollKey.currentState.scrollOffset, equals(0.0));
});
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment