Add default-no-clip tests to more buttons (#21012)
Note that such tests already exist for RaisedButton and MaterialButton
This commit is contained in:
@@ -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)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user