Skip to content

Commit 64f31b2

Browse files
authored
Update DataTable test when data row is pressed for Material 3 (flutter#137230)
This updates one of them M3 test to use golden test from flutter#135901 Keeping it consistent with this [update](flutter#136809 (comment))
1 parent 008a10f commit 64f31b2

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

packages/flutter/test/material/data_table_test.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// This file is run as part of a reduced test set in CI on Mac and Windows
6+
// machines.
7+
@Tags(<String>['reduced-test-set'])
58
@TestOn('!chrome')
69
library;
710

@@ -1725,16 +1728,11 @@ void main() {
17251728
));
17261729

17271730
final TestGesture gesture = await tester.startGesture(tester.getCenter(find.text('Content1')));
1728-
await tester.pump(const Duration(milliseconds: 200)); // splash is well underway
1729-
final RenderBox box = Material.of(tester.element(find.byType(InkWell)))as RenderBox;
1731+
await tester.pump(); // start the splash animation
1732+
await tester.pump(const Duration(milliseconds: 100)); // splash is underway
17301733
// Material 3 uses the InkSparkle which uses a shader, so we can't capture
1731-
// the effect with paint methods.
1732-
expect(
1733-
box,
1734-
paints
1735-
..rect()
1736-
..rect(rect: const Rect.fromLTRB(0.0, 56.0, 800.0, 104.0), color: pressedColor.withOpacity(0.0)),
1737-
);
1734+
// the effect with paint methods. Use a golden test instead.
1735+
await expectLater(find.byType(InkWell), matchesGoldenFile('data_table_test.data_row_pressed.png'));
17381736
await gesture.up();
17391737
});
17401738

@@ -2033,7 +2031,7 @@ void main() {
20332031
);
20342032

20352033
// Go without crashes.
2036-
2034+
expect(tester.takeException(), isNull);
20372035
});
20382036

20392037
testWidgetsWithLeakTracking('DataTable clip behavior', (WidgetTester tester) async {

0 commit comments

Comments
 (0)