Fix and reenable context_menus email button test (#1585)

pull/1586/head
Parker Lougheed 2 years ago committed by GitHub
parent be309ecc07
commit 4ab7f6c36b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,8 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'utils.dart';
void main() {
testWidgets(
'Selecting the email address shows a custom button',
testWidgets('Selecting the email address shows a custom button',
(tester) async {
await tester.pumpWidget(const MyApp());
@ -19,8 +18,9 @@ void main() {
await tester.dragUntilVisible(
find.text(EmailButtonPage.title),
find.byType(ListView),
const Offset(0.0, -200.0),
const Offset(0.0, -100.0),
);
await tester.pumpAndSettle();
await tester.tap(find.text(EmailButtonPage.title));
await tester.pumpAndSettle();
@ -49,8 +49,8 @@ void main() {
expect(find.text('Send email'), findsNothing);
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
expect(find.byType(CupertinoTextSelectionToolbarButton),
findsNWidgets(2));
expect(
find.byType(CupertinoTextSelectionToolbarButton), findsNWidgets(2));
break;
case TargetPlatform.macOS:
expect(find.byType(CupertinoDesktopTextSelectionToolbarButton),
@ -97,8 +97,8 @@ void main() {
expect(find.text('Send email'), findsOneWidget);
switch (defaultTargetPlatform) {
case TargetPlatform.iOS:
expect(find.byType(CupertinoTextSelectionToolbarButton),
findsNWidgets(3));
expect(
find.byType(CupertinoTextSelectionToolbarButton), findsNWidgets(3));
break;
case TargetPlatform.macOS:
expect(find.byType(CupertinoDesktopTextSelectionToolbarButton),
@ -114,7 +114,5 @@ void main() {
find.byType(DesktopTextSelectionToolbarButton), findsNWidgets(4));
break;
}
},
skip: true, // TODO(justinmc): Make this test pass and re-enable.
);
});
}

Loading…
Cancel
Save