feat(mobile): UI-01 upload center, capture and auxiliary pages

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-21 17:20:43 +08:00
parent f6929ae18f
commit 1f67b7c818
26 changed files with 2144 additions and 771 deletions
@@ -78,6 +78,34 @@ void main() {
await tester.tap(finder);
}
testWidgets('三分组结构(UI-01 §4.5):活动信息/多语言内容/访问设置 + 双语 tab',
(tester) async {
final adapter = FakeAdapter((_) => throw StateError('不应发起请求'));
await pumpForm(tester, clientOf(adapter));
// 三个分组标题(SectionHeader)。
expect(find.text('Event info'), findsOneWidget);
expect(find.text('Multilingual content'), findsOneWidget);
expect(find.text('Access settings'), findsOneWidget);
// 多语言内容:zh-CN/en 双语 tab(当前 zh tab → 标题已填默认语言星标)。
// 「中文/English」同时出现在内容 tab 与默认语言分段选择中,需锚定 TabBar。
final tabBar = find.byType(TabBar);
expect(find.descendant(of: tabBar, matching: find.text('中文')), findsOneWidget);
expect(
find.descendant(of: tabBar, matching: find.text('English')), findsOneWidget);
expect(find.text('Title *'), findsOneWidget, reason: '默认语言标题必填星标');
// 切到 en tab → 英文字段(非默认语言,无星标)。
await tester.tap(find.descendant(of: tabBar, matching: find.text('English')));
await tester.pumpAndSettle();
expect(find.text('Title'), findsOneWidget);
expect(find.text('Title *'), findsNothing);
// 访问设置:默认语言分段选择(两项)。
expect(find.byType(SegmentedButton<String>), findsOneWidget);
});
testWidgets('创建:空表单提交 → 汇总错误(默认语言标题/开始时间),不发请求',
(tester) async {
final adapter = FakeAdapter((_) => throw StateError('不应发起请求'));
@@ -193,9 +221,10 @@ void main() {
// 编辑模式四开关。
expect(find.byType(SwitchListTile), findsNWidgets(4));
// 字段预填(当前 zh tab;title 为第一个文本字段)。
// 字段预填(当前 zh tab;UI-01 分组后 TextFormField 顺序 = 时区 →
// 标题(zh tab),标题取第 2 个)。
final titleField = tester.widget<TextFormField>(
find.byType(TextFormField).first,
find.byType(TextFormField).at(1),
);
expect(titleField.controller!.text, '开幕晚宴');
// 开关初值与原相册一致。
@@ -291,7 +320,7 @@ void main() {
await pumpForm(tester, clientOf(adapter), existing: existing);
await tester.enterText(
find.byType(TextFormField).first,
find.byType(TextFormField).at(1),
'闭幕演出',
);
await tester.pump();