feat(publish): the Publish sheet lists the tag names a release sends (ADR 0019)
Before Publish, the sheet shows the names of the tags that go with the release, which the instance learns, sorted, or that none go; none where they can't be had, as something in the tree is private (the short reading of 22 Oct, finding 5). In English and German. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
5a61f2ea07
commit
9841d2d864
1 changed files with 137 additions and 8 deletions
|
|
@ -0,0 +1,42 @@
|
|||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:halkyon_learn_flutter/src/core/l10n/app_languages.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/publish/widget/publish_sheet.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
|
||||
/// The Publish sheet shows the names of the tags a release sends before
|
||||
/// Publish, as the instance learns each (ADR 0019, the short reading of 22
|
||||
/// Oct).
|
||||
void main() {
|
||||
Future<void> pump(
|
||||
WidgetTester tester,
|
||||
Future<Map<String, String>> names,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
localizationsDelegates: appLocalizationsDelegates,
|
||||
home: Scaffold(body: PublishTagNames(names: names)),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
}
|
||||
|
||||
testWidgets('lists every name sent, sorted', (tester) async {
|
||||
await pump(tester, Future.value({'t2': 'Verbs', 't1': 'JLPT-N3'}));
|
||||
|
||||
expect(find.textContaining('JLPT-N3, Verbs'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('says when none go with it', (tester) async {
|
||||
await pump(tester, Future.value(const {}));
|
||||
|
||||
expect(find.text('No tags go with it.'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('shows no name where they can not be had (something private)', (
|
||||
tester,
|
||||
) async {
|
||||
await pump(tester, Future(() => throw StateError('private')));
|
||||
|
||||
expect(find.textContaining('JLPT'), findsNothing);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue