mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-11 18:28:56 +02:00
fix(home): clear recent activity permanently
This commit is contained in:
1 parent
b1180a70a7
commit
75e1cf17b8
19 files changed
+173
-22
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:spotiflac_android/providers/recent_access_provider.dart';
|
||||
|
||||
void main() {
|
||||
group('Recent download clear boundary', () {
|
||||
final clearedAt = DateTime.parse('2026-08-22T12:00:00.000Z');
|
||||
|
||||
test('keeps downloads when Recent has never been cleared', () {
|
||||
expect(
|
||||
isRecentDownloadAfterClear(
|
||||
DateTime.parse('2026-08-01T00:00:00.000Z'),
|
||||
null,
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('removes downloads recorded at or before Clear all', () {
|
||||
expect(
|
||||
isRecentDownloadAfterClear(
|
||||
DateTime.parse('2026-08-22T11:59:59.999Z'),
|
||||
clearedAt,
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
expect(isRecentDownloadAfterClear(clearedAt, clearedAt), isFalse);
|
||||
});
|
||||
|
||||
test('allows new downloads after Clear all', () {
|
||||
expect(
|
||||
isRecentDownloadAfterClear(
|
||||
DateTime.parse('2026-08-22T12:00:00.001Z'),
|
||||
clearedAt,
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user