feat(app): the path editor in two cards, as before
On the tinted ground, one card holds the path's details (title, secondary title, a line, the description row, a line, its tags behind an Add tags chip) and one below holds its steps under their header, lines between them, filling the window at least. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
0d46c04a44
commit
252110832a
1 changed files with 255 additions and 120 deletions
|
|
@ -6,6 +6,7 @@ import 'package:halkyon_learn_flutter/src/core/citation/model/source.dart';
|
|||
import 'package:halkyon_learn_flutter/src/core/content/rich_content.dart';
|
||||
import 'package:halkyon_learn_flutter/src/core/device_settings/model/device_settings.dart';
|
||||
import 'package:halkyon_learn_flutter/src/core/router/route_paths.dart';
|
||||
import 'package:halkyon_learn_flutter/src/core/widget/section_card.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/data/learning_path_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/model/exercise.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/model/learning_path.dart';
|
||||
|
|
@ -186,6 +187,33 @@ void main() {
|
|||
expect(find.text('Which one?'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets("the path editor groups the path's details in one card and its "
|
||||
'steps in another, filling the window below', (tester) async {
|
||||
final paths = repository();
|
||||
final id = await paths.createPath(
|
||||
'japanese',
|
||||
LearningPathContent.titled('Particles'),
|
||||
);
|
||||
await paths.createStep(id, StepKind.info, step(StepKind.info, 'Read'));
|
||||
await showApp(tester, RoutePaths.editPath('japanese', id));
|
||||
|
||||
final cards = find.byType(SectionCard);
|
||||
expect(cards, findsNWidgets(2));
|
||||
Finder inCard(int index, Finder part) =>
|
||||
find.descendant(of: cards.at(index), matching: part);
|
||||
for (final part in ['Particles', 'Description', 'Add a description']) {
|
||||
expect(inCard(0, find.text(part)), findsOneWidget, reason: part);
|
||||
}
|
||||
expect(inCard(0, find.widgetWithText(ActionChip, 'Add tags')), findsOne);
|
||||
for (final part in ['Steps', 'Add step', 'Read']) {
|
||||
expect(inCard(1, find.text(part)), findsOneWidget, reason: part);
|
||||
}
|
||||
expect(
|
||||
tester.getRect(cards.at(1)).bottom,
|
||||
moreOrLessEquals(1000 - 12, epsilon: 1),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('imports a path from a file, saying what came in and what was '
|
||||
'left out', (tester) async {
|
||||
files.next = (
|
||||
|
|
|
|||
Loading…
Reference in a new issue