todo-app/test/text_free_list_test.dart
Krzysztof kuhy Rudnicki 3a747c2e51
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
Report errors and slow waits to the board
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>
2026-11-17 23:07:58 +01:00

109 lines
2.8 KiB
Dart

/// Textgate guard for the notes list and the sheets it opens: nothing
/// app-written is painted, only note content, numbers and glyphs.
library;
import 'package:material_ui/material_ui.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:todo/data/note.dart';
import 'notes_list_harness.dart';
import 'text_free_guard.dart';
const _content = [
'Buy milk',
'Fix sync',
'kuhyx/todo-app',
'flutter test',
'claude',
'green run',
'todo-app',
];
final _task = Note(
id: 't',
text: 'Fix sync',
priority: Priority.high,
status: Status.inProgress,
createdAt: DateTime(2026, 6, 15, 9),
updatedAt: DateTime(2026, 6, 15, 9),
repo: 'kuhyx/todo-app',
doneCheck: 'flutter test',
by: 'claude',
evidence: 'green run',
);
void _size(WidgetTester t, Size s, double dpr) {
t.view
..physicalSize = s
..devicePixelRatio = dpr;
addTearDown(t.view.reset);
}
void _desktop(WidgetTester t) => _size(t, const Size(1600, 1000), 1);
void _phone(WidgetTester t) => _size(t, const Size(1080, 2400), 2.625);
Future<void> _settle(WidgetTester t) async {
await t.pump();
await t.pump(const Duration(milliseconds: 300));
}
void main() {
testWidgets('the empty list paints no words', (t) async {
_desktop(t);
await pumpList(t);
expectNoChromeWords(t);
});
testWidgets('the filtered-empty list paints no words', (t) async {
_desktop(t);
await pumpList(
t,
seed: [note('a', 'Buy milk', status: Status.done)],
applyFilter: true,
);
expectNoChromeWords(t);
});
testWidgets('the desktop list paints only note content', (t) async {
_desktop(t);
await pumpList(t, seed: [note('a', 'Buy milk'), note('e', ''), _task]);
expectNoChromeWords(t, content: _content);
});
testWidgets('the phone grid paints only note content', (t) async {
_phone(t);
await pumpList(t, seed: [note('a', 'Buy milk'), note('e', ''), _task]);
expectNoChromeWords(t, content: _content);
});
testWidgets('the filter sheet paints no words', (t) async {
_phone(t);
await pumpList(t, seed: [note('a', 'Buy milk')], applyFilter: true);
await t.tap(find.byIcon(Icons.filter_list));
await _settle(t);
expectNoChromeWords(t, content: _content);
});
testWidgets('an opened note paints only its content', (t) async {
_desktop(t);
await pumpList(t, seed: [_task]);
await t.tap(find.text('Fix sync'));
await _settle(t);
expectNoChromeWords(t, content: _content);
});
for (final (name, title) in [
('plain note', 'Buy milk'),
('task', 'Fix sync'),
]) {
testWidgets('the $name sheet paints only note content', (t) async {
_phone(t);
await pumpList(t, seed: [note('a', 'Buy milk'), _task]);
await t.longPress(find.text(title));
await _settle(t);
expectNoChromeWords(t, content: _content);
});
}
}