Unverified Commit abcfdfb9 authored by xubaolin's avatar xubaolin Committed by GitHub

fix some unit test cases(ink_well_test.dart) bug (#70447)

This change fixes some bugs in ink_well_test.dart.
parent 1219dd7b
...@@ -185,7 +185,7 @@ void main() { ...@@ -185,7 +185,7 @@ void main() {
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
final RenderObject inkFeatures = tester.allRenderObjects.firstWhere((RenderObject object) => object.runtimeType.toString() == '_RenderInkFeatures'); final RenderObject inkFeatures = tester.allRenderObjects.firstWhere((RenderObject object) => object.runtimeType.toString() == '_RenderInkFeatures');
expect(inkFeatures, paintsExactlyCountTimes(#rect, 0)); expect(inkFeatures, paintsExactlyCountTimes(#drawRect, 0));
focusNode.requestFocus(); focusNode.requestFocus();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(inkFeatures, paints expect(inkFeatures, paints
...@@ -228,7 +228,7 @@ void main() { ...@@ -228,7 +228,7 @@ void main() {
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
final RenderObject inkFeatures = tester.allRenderObjects.firstWhere((RenderObject object) => object.runtimeType.toString() == '_RenderInkFeatures'); final RenderObject inkFeatures = tester.allRenderObjects.firstWhere((RenderObject object) => object.runtimeType.toString() == '_RenderInkFeatures');
expect(inkFeatures, paintsExactlyCountTimes(#rect, 0)); expect(inkFeatures, paintsExactlyCountTimes(#drawRect, 0));
focusNode.requestFocus(); focusNode.requestFocus();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(inkFeatures, paints expect(inkFeatures, paints
...@@ -350,12 +350,11 @@ void main() { ...@@ -350,12 +350,11 @@ void main() {
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: Focus(
focusNode: focusNode,
child: Container( child: Container(
width: 100, width: 100,
height: 100, height: 100,
child: InkWell( child: InkWell(
focusNode: focusNode,
hoverColor: const Color(0xff00ff00), hoverColor: const Color(0xff00ff00),
splashColor: const Color(0xffff0000), splashColor: const Color(0xffff0000),
focusColor: const Color(0xff0000ff), focusColor: const Color(0xff0000ff),
...@@ -367,14 +366,13 @@ void main() { ...@@ -367,14 +366,13 @@ void main() {
), ),
), ),
), ),
),
)); ));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
final RenderObject inkFeatures = tester.allRenderObjects.firstWhere((RenderObject object) => object.runtimeType.toString() == '_RenderInkFeatures'); final RenderObject inkFeatures = tester.allRenderObjects.firstWhere((RenderObject object) => object.runtimeType.toString() == '_RenderInkFeatures');
expect(inkFeatures, paintsExactlyCountTimes(#rect, 0)); expect(inkFeatures, paintsExactlyCountTimes(#drawRect, 0));
focusNode.requestFocus(); focusNode.requestFocus();
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(inkFeatures, paintsExactlyCountTimes(#rect, 0)); expect(inkFeatures, paintsExactlyCountTimes(#drawRect, 0));
}); });
testWidgets('InkWell.mouseCursor changes cursor on hover', (WidgetTester tester) async { testWidgets('InkWell.mouseCursor changes cursor on hover', (WidgetTester tester) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment