Skip to content

Commit 86fc1fd

Browse files
Add test for raw_scrollbar.shape.0.dart (flutter#158094)
Contributes to flutter#130459 It adds a test for - `examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart`
1 parent 2a2a1de commit 86fc1fd

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

dev/bots/check_code_samples.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,5 +314,4 @@ final Set<String> _knownMissingTests = <String>{
314314
'examples/api/test/widgets/image/image.loading_builder.0_test.dart',
315315
'examples/api/test/widgets/scrollbar/raw_scrollbar.2_test.dart',
316316
'examples/api/test/widgets/scrollbar/raw_scrollbar.desktop.0_test.dart',
317-
'examples/api/test/widgets/scrollbar/raw_scrollbar.shape.0_test.dart',
318317
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2014 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:flutter/material.dart';
6+
import 'package:flutter_api_samples/widgets/scrollbar/raw_scrollbar.shape.0.dart' as example;
7+
import 'package:flutter_test/flutter_test.dart';
8+
9+
void main() {
10+
testWidgets('The thumb shape is a stadium border', (WidgetTester tester) async {
11+
await tester.pumpWidget(
12+
const example.ShapeExampleApp(),
13+
);
14+
15+
expect(find.byType(RawScrollbar), findsOne);
16+
expect(find.byType(ListView), findsOne);
17+
18+
expect(find.text('0'), findsOne);
19+
expect(find.text('1'), findsOne);
20+
expect(find.text('4'), findsOne);
21+
22+
await tester.pumpAndSettle();
23+
24+
expect(
25+
find.byType(RawScrollbar),
26+
paints
27+
..path(color: Colors.blue)
28+
..rrect(
29+
rrect: RRect.fromLTRBR(786.5, 1.5, 798.5, 178.5, const Radius.circular(6)),
30+
color: Colors.brown,
31+
),
32+
);
33+
});
34+
}

0 commit comments

Comments
 (0)