mirror of
https://github.com/immich-app/immich
synced 2026-08-22 13:13:05 +00:00
* 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
24 lines
925 B
Dart
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);
|
|
});
|
|
}
|