mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 06:48:26 +00:00
testing_app code review and improvements (#960)
This commit is contained in:
@@ -53,15 +53,17 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Get the total number of items available.
|
||||
var totalItems = tester.widgetList(find.byIcon(Icons.close)).length;
|
||||
final totalItems = tester.widgetList(find.byIcon(Icons.close)).length;
|
||||
|
||||
// Remove one item.
|
||||
await tester.tap(find.byIcon(Icons.close).first);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Check if removed properly.
|
||||
expect(tester.widgetList(find.byIcon(Icons.close)).length,
|
||||
lessThan(totalItems));
|
||||
expect(
|
||||
tester.widgetList(find.byIcon(Icons.close)).length,
|
||||
lessThan(totalItems),
|
||||
);
|
||||
|
||||
// Verify if the appropriate message is shown.
|
||||
expect(find.text('Removed from favorites.'), findsOneWidget);
|
||||
|
||||
Reference in New Issue
Block a user