Update failed tests

This commit is contained in:
Qun Cheng 2024-11-18 21:54:59 -08:00
parent c91c18ebc5
commit bc9150d33e
5 changed files with 7 additions and 7 deletions

View File

@ -15,7 +15,7 @@ void main() {
expect(find.byType(Divider), findsOneWidget);
// Divider is positioned horizontally.
final Offset container = tester.getBottomLeft(find.byType(ColoredBox).first);
final Offset container = tester.getBottomLeft(find.descendant(of: find.byType(Expanded).first, matching: find.byType(ColoredBox)));
expect(container.dy, tester.getTopLeft(find.byType(Divider)).dy);
final Offset subheader = tester.getTopLeft(find.text('Subheader'));

View File

@ -19,7 +19,7 @@ void main() {
final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
await gesture.addPointer();
await gesture.down(tester.getCenter(find.byType(ColoredBox)));
await gesture.down(tester.getCenter(find.byType(ColoredBox).last));
await tester.pump();
expect(find.text('1 presses\n0 releases'), findsOneWidget);

View File

@ -18,14 +18,14 @@ void main() {
final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse);
await gesture.addPointer();
await gesture.moveTo(tester.getCenter(find.byType(ColoredBox)));
await gesture.moveTo(tester.getCenter(find.byType(ColoredBox).last));
await tester.pump();
expect(find.text('1 Entries\n0 Exits'), findsOneWidget);
expect(find.text('The cursor is here: (400.00, 328.00)'), findsOneWidget);
await gesture.moveTo(
tester.getCenter(find.byType(ColoredBox)) + const Offset(50.0, 30.0),
tester.getCenter(find.byType(ColoredBox).last) + const Offset(50.0, 30.0),
);
await tester.pump();

View File

@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Shows flutter logo in transition', (WidgetTester tester) async {
await tester.pumpWidget(const example.AlignTransitionExampleApp());
expect(find.byType(ColoredBox), findsOneWidget);
expect(find.byType(ColoredBox).last, findsOneWidget);
expect(
find.byWidgetPredicate((Widget padding) => padding is Padding
&& padding.padding == const EdgeInsets.all(8.0)),

View File

@ -19,7 +19,7 @@ void main() {
find.ancestor(
of: find.byType(FlutterLogo),
matching: find.descendant(
of: find.byType(ColoredBox),
of: find.byType(ColoredBox).last,
matching: find.byType(FadeTransition)
),
),
@ -35,7 +35,7 @@ void main() {
final Finder fadeTransitionFinder = find.ancestor(
of: find.byType(FlutterLogo),
matching: find.descendant(
of: find.byType(ColoredBox),
of: find.byType(ColoredBox).last,
matching: find.byType(FadeTransition)
),
);