feat(backup): tap automatic-backups to make a copy now
This commit is contained in:
parent
7cba4f7fcf
commit
e90a3831f2
4 changed files with 112 additions and 9 deletions
|
|
@ -139,6 +139,21 @@ void main() {
|
|||
]);
|
||||
});
|
||||
|
||||
test('backupNow writes even when a copy is not yet due', () async {
|
||||
final store = AutoBackupStore(InMemorySecretStore());
|
||||
await store.markBackupAt(DateTime.utc(2026, 7, 10)); // today: not due
|
||||
final service = newService(
|
||||
newExporter(),
|
||||
store: store,
|
||||
now: DateTime.utc(2026, 7, 10),
|
||||
);
|
||||
|
||||
// runIfDue is a no-op today, but an explicit tap still makes a copy.
|
||||
expect(await service.runIfDue(), isFalse);
|
||||
expect(await service.backupNow(), isTrue);
|
||||
expect(autoCopies(), ['tanemaki-auto-2026-07-10.tanemaki']);
|
||||
});
|
||||
|
||||
test('a failed backup returns false and never throws', () async {
|
||||
final service = newService(
|
||||
_ThrowingExporter(db),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue