mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
test: scroll service test for editor
This commit is contained in:
parent
43e4b1efad
commit
4d89b7a24e
@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import '../infra/test_editor.dart';
|
||||
|
||||
void main() async {
|
||||
setUpAll(() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
});
|
||||
|
||||
group('Testing Scroll With Gestures', () {
|
||||
testWidgets('Test Gestsure Scroll', (tester) async {
|
||||
final editor = tester.editor;
|
||||
for (var i = 0; i < 100; i++) {
|
||||
editor.insertTextNode('$i');
|
||||
}
|
||||
editor.insertTextNode('mark');
|
||||
for (var i = 100; i < 200; i++) {
|
||||
editor.insertTextNode('$i');
|
||||
}
|
||||
await editor.startTesting();
|
||||
|
||||
final listFinder = find.byType(Scrollable);
|
||||
final itemFinder = find.text('mark', findRichText: true);
|
||||
|
||||
await tester.scrollUntilVisible(itemFinder, 500.0,
|
||||
scrollable: listFinder);
|
||||
|
||||
expect(itemFinder, findsOneWidget);
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user