mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-19 20:14:22 +01:00
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
file-length / file length <= 250 lines (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled
crdt_sync_flutter 0.9.0's installAppErrors in main(): uncaught errors and every spinner shown over 1 s (WaitWatch: sync.run, mirror.test) upload to RTDB /todo/errors/<device> with the versionCode, where the PC app-errors ingest files board tickets (kuhyx/utils DOCS-app-errors.md). The app moves to material_ui first: sync_settings_ui 0.8.x and design_system 0.4.x sit on it, and Flutter 3.50 deprecates flutter/material. Pins: crdt_sync 0.14.1, csf 0.9.0, ssui 0.8.3, gda 0.5.1, design_system 0.4.1, image 4.13.1, mcp_dart 2.4.4. file_picker stays 13.3.3, held by data_transfer_flutter 0.2.2 (allowlisted, self-clearing). appRoute takes a route name so each report names its screen; the release build passes APP_BUILD/APP_VERSION. Nothing new on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
1.7 KiB
Dart
55 lines
1.7 KiB
Dart
import 'package:material_ui/material_ui.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:todo/ui/note_detail_screen.dart';
|
|
|
|
import 'notes_list_harness.dart';
|
|
|
|
/// Whether any text field holds focus, i.e. Android would show the keyboard.
|
|
bool textFieldFocused() =>
|
|
FocusManager.instance.primaryFocus?.context
|
|
?.findAncestorWidgetOfExactType<EditableText>() !=
|
|
null;
|
|
|
|
/// Opens the first note, types into its editor, then backs out the way the
|
|
/// Android back swipe does (a system pop, not the app-bar arrow).
|
|
Future<void> editNoteAndSwipeBack(WidgetTester tester) async {
|
|
await tester.tap(find.text('Buy milk'));
|
|
await tester.pump();
|
|
await tester.pump(const Duration(milliseconds: 500));
|
|
await tester.tap(
|
|
find
|
|
.descendant(
|
|
of: find.byType(NoteDetailScreen),
|
|
matching: find.byType(EditableText),
|
|
)
|
|
.first,
|
|
);
|
|
await tester.pump();
|
|
expect(textFieldFocused(), isTrue);
|
|
await tester.binding.handlePopRoute();
|
|
await tester.pump(const Duration(milliseconds: 500));
|
|
}
|
|
|
|
void main() {
|
|
testWidgets('backing out of a note leaves no text field focused', (
|
|
tester,
|
|
) async {
|
|
await pumpList(tester, seed: [note('a', 'Buy milk')]);
|
|
await editNoteAndSwipeBack(tester);
|
|
expect(find.byIcon(Icons.search), findsOneWidget);
|
|
expect(textFieldFocused(), isFalse);
|
|
});
|
|
|
|
testWidgets('backing out does not re-focus a search box used earlier', (
|
|
tester,
|
|
) async {
|
|
await pumpList(tester, seed: [note('a', 'Buy milk')]);
|
|
await tester.tap(find.byType(TextField).first);
|
|
await tester.pump();
|
|
await editNoteAndSwipeBack(tester);
|
|
expect(find.byIcon(Icons.search), findsOneWidget);
|
|
expect(textFieldFocused(), isFalse);
|
|
});
|
|
}
|