From 70e9b4185e3d539c04abb73240d8830c93290470 Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 12:35:26 +0000 Subject: [PATCH] Reverts "Add tests for form_text_field.1.dart (#150481)" (#150696) Reverts: flutter/flutter#150481 Initiated by: cbracken Reason for reverting: Surprisingly, the following test seems to be consistently failing on Windows after the addition of this test: ``` flutter/packages/flutter/test/widgets/sliver_tree_test.dart: .toggleNodeWith, onNodeToggle ``` Original PR Author: ValentinVignal Reviewed By: {TahaTesser, bleroux} This change reverts the following previous change: Contributes to https://github.com/flutter/flutter/issues/130459 It adds a test for - `examples/api/lib/material/text_form_field/text_form_field.1.dart` --- dev/bots/check_code_samples.dart | 1 + .../text_form_field.1_test.dart | 58 ------------------- 2 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 examples/api/test/material/text_form_field/text_form_field.1_test.dart diff --git a/dev/bots/check_code_samples.dart b/dev/bots/check_code_samples.dart index af7713fdf7..1d076a6ebb 100644 --- a/dev/bots/check_code_samples.dart +++ b/dev/bots/check_code_samples.dart @@ -325,6 +325,7 @@ final Set _knownMissingTests = { 'examples/api/test/material/flexible_space_bar/flexible_space_bar.0_test.dart', 'examples/api/test/material/chip/deletable_chip_attributes.on_deleted.0_test.dart', 'examples/api/test/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0_test.dart', + 'examples/api/test/material/text_form_field/text_form_field.1_test.dart', 'examples/api/test/material/scrollbar/scrollbar.1_test.dart', 'examples/api/test/material/search_anchor/search_anchor.0_test.dart', 'examples/api/test/material/search_anchor/search_anchor.1_test.dart', diff --git a/examples/api/test/material/text_form_field/text_form_field.1_test.dart b/examples/api/test/material/text_form_field/text_form_field.1_test.dart deleted file mode 100644 index e15d6f711f..0000000000 --- a/examples/api/test/material/text_form_field/text_form_field.1_test.dart +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_api_samples/material/text_form_field/text_form_field.1.dart' as example; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - testWidgets('Pressing space should focus the next field', (WidgetTester tester) async { - await tester.pumpWidget(const example.TextFormFieldExampleApp()); - final Finder textFormField = find.byType(TextFormField); - - expect(textFormField, findsExactly(5)); - - final Finder editableText = find.byType(EditableText); - expect(editableText, findsExactly(5)); - - List getFocuses() { - return editableText.evaluate() - .map((Element finderResult) => (finderResult.widget as EditableText).focusNode.hasFocus) - .toList(); - } - - expect(getFocuses(), const [false, false, false, false, false]); - - await tester.tap(textFormField.first); - await tester.pump(); - - expect(getFocuses(), const [true, false, false, false, false]); - - await tester.sendKeyEvent(LogicalKeyboardKey.space); - await tester.pump(); - - expect(getFocuses(), const [false, true, false, false, false]); - - await tester.sendKeyEvent(LogicalKeyboardKey.space); - await tester.pump(); - - expect(getFocuses(), const [false, false, true, false, false]); - - await tester.sendKeyEvent(LogicalKeyboardKey.space); - await tester.pump(); - - expect(getFocuses(), const [false, false, false, true, false]); - - await tester.sendKeyEvent(LogicalKeyboardKey.space); - await tester.pump(); - - expect(getFocuses(), const [false, false, false, false, true]); - - await tester.sendKeyEvent(LogicalKeyboardKey.space); - await tester.pump(); - - expect(getFocuses(), const [true, false, false, false, false]); - }); -}