immich/mobile/test/pages/common/download_panel_test.dart
Santo Shakil 9ab12b0c4e
fix(mobile): mark finished downloads complete instead of leaving them stuck (#29023)
* wire download status to the ui and dismiss finished entries

* mark finished downloads with a checkmark instead of dismissing

* use the theme color for the done icon and guard status updates on a known task
2026-08-17 16:10:26 +06:00

24 lines
925 B
Dart

import 'package:background_downloader/background_downloader.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:immich_mobile/pages/common/download_panel.dart';
import '../../widget_tester_extensions.dart';
void main() {
testWidgets('complete uses a checkmark and other statuses use close', (tester) async {
await tester.pumpConsumerWidget(
DownloadTaskTile(progress: 1, fileName: 'photo.jpg', status: TaskStatus.complete, onCancelDownload: () {}),
);
expect(find.byIcon(Icons.download_done), findsOneWidget);
expect(find.byIcon(Icons.close), findsNothing);
await tester.pumpConsumerWidget(
DownloadTaskTile(progress: 1, fileName: 'photo.jpg', status: TaskStatus.failed, onCancelDownload: () {}),
);
expect(find.byIcon(Icons.download_done), findsNothing);
expect(find.byIcon(Icons.close), findsOneWidget);
});
}