这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,20 @@ void main() {

expect(tester.getTopLeft(find.byType(DesktopTextSelectionToolbarButton)), anchor);
});

testWidgets('DesktopTextSelectionToolbar renders at zero area', (WidgetTester tester) async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
testWidgets('DesktopTextSelectionToolbar renders at zero area', (WidgetTester tester) async {
testWidgets('DesktopTextSelectionToolbar does not crash at zero area', (WidgetTester tester) async {

await tester.pumpWidget(
MaterialApp(
home: Center(
child: SizedBox.shrink(
child: DesktopTextSelectionToolbar(
anchor: const Offset(10, 10),
children: const <Widget>[Text('X')],
),
),
),
),
);
expect(tester.getSize(find.byType(DesktopTextSelectionToolbar)).isEmpty, isTrue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(tester.getSize(find.byType(DesktopTextSelectionToolbar)).isEmpty, isTrue);
expect(tester.getSize(find.byType(DesktopTextSelectionToolbar)), Size.zero);

});
}