mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Reland of https://github.com/flutter/flutter/pull/147171
It was reverted for a failing unit test that had passed in presubmit. Hopefully this sticks better.
Also fixed leaks in 37b10adc90
22 lines
717 B
Dart
22 lines
717 B
Dart
// 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_tree.1.dart'
|
|
as example;
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
testWidgets('Can toggle nodes in TreeSliver', (WidgetTester tester) async {
|
|
await tester.pumpWidget(
|
|
const example.TreeSliverExampleApp(),
|
|
);
|
|
expect(find.text('lib'), findsOneWidget);
|
|
expect(find.text('src'), findsNothing);
|
|
// Toggle tree node.
|
|
await tester.tap(find.text('lib'));
|
|
await tester.pumpAndSettle();
|
|
expect(find.text('src'), findsOneWidget);
|
|
});
|
|
}
|