Skip to content

Commit 980c8a7

Browse files
authored
Add golden test for clipping (#20750)
For #20483
1 parent 09fec4c commit 980c8a7

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎bin/internal/goldens.version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6c45fafdf5e3231406e1921285767f6ca8c05d6e
1+
d0800cf4170e77682173c19703f605c6795e0ff8

‎packages/flutter/test/material/floating_action_button_test.dart‎

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

5+
import 'dart:io';
56
import 'dart:ui';
67

78
import 'package:flutter/material.dart';
@@ -408,4 +409,33 @@ void main() {
408409
expect(shortFAB, findsNothing);
409410
expect(helloWorld, findsOneWidget);
410411
});
412+
413+
// This test prevents https://github.com/flutter/flutter/issues/20483
414+
testWidgets('Floating Action Button clips ink splash and highlight', (WidgetTester tester) async {
415+
final GlobalKey key = new GlobalKey();
416+
await tester.pumpWidget(
417+
new MaterialApp(
418+
home: new Scaffold(
419+
body: new Center(
420+
child: new RepaintBoundary(
421+
key: key,
422+
child: new FloatingActionButton(
423+
onPressed: () {},
424+
child: const Icon(Icons.add),
425+
),
426+
),
427+
),
428+
),
429+
),
430+
);
431+
432+
await tester.press(find.byKey(key));
433+
await tester.pump();
434+
await tester.pump(const Duration(milliseconds: 1000));
435+
await expectLater(
436+
find.byKey(key),
437+
matchesGoldenFile('floating_action_button_test.clip.1.png'),
438+
skip: !Platform.isLinux,
439+
);
440+
});
411441
}

0 commit comments

Comments
 (0)