mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
[testing_app] added basic placeholder for favorites list (#581)
This commit is contained in:
@@ -28,6 +28,14 @@ void addItems() {
|
||||
|
||||
void main() {
|
||||
group('Favorites Page Widget Tests', () {
|
||||
testWidgets('Test if Placeholder shows in case of empty list',
|
||||
(tester) async {
|
||||
await tester.pumpWidget(createFavoritesScreen());
|
||||
|
||||
// Verify if the placeholder text shows up.
|
||||
expect(find.text('No favorites added.'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Test if ListView shows up', (tester) async {
|
||||
await tester.pumpWidget(createFavoritesScreen());
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ void main() {
|
||||
var favorites = Favorites();
|
||||
|
||||
test('A new item should be added', () {
|
||||
// Generate a random number.
|
||||
var number = 35;
|
||||
|
||||
// Add the number to the list.
|
||||
@@ -22,7 +21,6 @@ void main() {
|
||||
});
|
||||
|
||||
test('An item should be removed', () {
|
||||
// Generate a random number.
|
||||
var number = 45;
|
||||
|
||||
// Add the number to the list.
|
||||
|
||||
Reference in New Issue
Block a user