feat: widget finders add widgetWithImage method (#89020)

This commit is contained in:
嘟囔
2021-08-27 13:11:02 +08:00
committed by GitHub
parent a7bc0484bd
commit 7df68b906c
2 changed files with 31 additions and 0 deletions

View File

@@ -16,6 +16,13 @@ void main() {
));
expect(find.image(FileImage(File('test'), scale: 1.0)), findsOneWidget);
});
testWidgets('finds Button widgets with Image', (WidgetTester tester) async {
await tester.pumpWidget(_boilerplate(
ElevatedButton(onPressed: null, child: Image(image: FileImage(File('test'), scale: 1.0)),)
));
expect(find.widgetWithImage(ElevatedButton, FileImage(File('test'), scale: 1.0)), findsOneWidget);
});
});
group('text', () {