diff --git a/packages/flutter/test/material/buttons_test.dart b/packages/flutter/test/material/buttons_test.dart index 7209d48d71..5328ac9b51 100644 --- a/packages/flutter/test/material/buttons_test.dart +++ b/packages/flutter/test/material/buttons_test.dart @@ -520,4 +520,22 @@ void main() { expect(tester.getSize(find.byKey(key2)), const Size(88.0, 36.0)); }); + + testWidgets('RaisedButton has no clip by default', (WidgetTester tester) async{ + await tester.pumpWidget( + new Directionality( + textDirection: TextDirection.ltr, + child: new Material( + child: new RaisedButton( + onPressed: () { /* to make sure the button is enabled */ }, + ), + ) + ), + ); + + expect( + tester.renderObject(find.byType(RaisedButton)), + paintsExactlyCountTimes(#clipPath, 0) + ); + }); } diff --git a/packages/flutter/test/material/flat_button_test.dart b/packages/flutter/test/material/flat_button_test.dart index a2192c40c4..3a7535e5de 100644 --- a/packages/flutter/test/material/flat_button_test.dart +++ b/packages/flutter/test/material/flat_button_test.dart @@ -6,6 +6,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; +import '../rendering/mock_canvas.dart'; + void main() { testWidgets('FlatButton implements debugFillDescription', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = new DiagnosticPropertiesBuilder(); @@ -29,4 +31,23 @@ void main() { 'splashColor: Color(0xff9e9e9e)', ]); }); + + testWidgets('FlatButton has no clip by default', (WidgetTester tester) async{ + await tester.pumpWidget( + new Directionality( + textDirection: TextDirection.ltr, + child: new Material( + child: new FlatButton( + child: new Container(), + onPressed: () { /* to make sure the button is enabled */ }, + ), + ) + ), + ); + + expect( + tester.renderObject(find.byType(FlatButton)), + paintsExactlyCountTimes(#clipPath, 0) + ); + }); } diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index f50f3e16a4..a79892b19f 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -9,6 +9,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_test/flutter_test.dart'; +import '../rendering/mock_canvas.dart'; import '../widgets/semantics_tester.dart'; void main() { @@ -438,4 +439,22 @@ void main() { skip: !Platform.isLinux, ); }); + + testWidgets('Floating Action Button has no clip by default', (WidgetTester tester) async{ + await tester.pumpWidget( + new Directionality( + textDirection: TextDirection.ltr, + child: new Material( + child: new FloatingActionButton( + onPressed: () { /* to make sure the button is enabled */ }, + ), + ) + ), + ); + + expect( + tester.renderObject(find.byType(FloatingActionButton)), + paintsExactlyCountTimes(#clipPath, 0) + ); + }); }