// Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter_api_samples/widgets/sliver/sliver_list.0.dart' as example; import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('SliverList example', (WidgetTester tester) async { await tester.pumpWidget(const example.SliverListExampleApp()); expect(find.text('Item 4'), findsOneWidget); expect(find.text('Item 5'), findsNothing); // Add item. await tester.tap(find.byTooltip('Add item')); await tester.pumpAndSettle(); expect(find.text('Item 5'), findsOneWidget); }); }