feat(task): show a dash for completed tasks without a done time

Tasks completed before this change have no doneAt value; the drawer now
always renders the Completed at row for completed tasks and falls back
to a dash instead of hiding the row.
This commit is contained in:
Levi committed 2026-09-20 09:28:46 +08:00
1 parent 1d8a502ac4
commit 7bc7efed5b
2 files changed
+32 -2

No files matched your search

+24
View File
@@ -4267,6 +4267,30 @@ void main() {
expect(find.text('—'), findsOneWidget);
});
testWidgets('completed task details show a dash when no done time is recorded', (WidgetTester tester) async {
await _setTestSize(tester, const Size(900, 700));
final task = _taskRecord(
id: 'done-details',
name: 'done.zip',
status: TaskStatus.completed,
downloadDuration: const Duration(hours: 1, minutes: 2, seconds: 3),
);
await tester.pumpWidget(
ProviderScope(
child: shad.ShadcnApp(
theme: AppTheme.light(),
materialTheme: AppTheme.materialLight(),
home: TaskDetailsView(task: task, mobile: false, onOpenStorage: () {}, onUpdateUrl: (_) async {}),
),
),
);
await tester.pumpAndSettle();
expect(find.text('Completed at'), findsOneWidget);
expect(find.text('—'), findsOneWidget);
});
testWidgets('failed task details omit the unavailable error reason', (WidgetTester tester) async {
await _setTestSize(tester, const Size(900, 700));
final task = TaskRecord(