feat: enhance backup status display and tracking
Added a visual indicator for backups saved today in the admin interface. Updated the backup status type to include a boolean for today's backup existence, and modified relevant components to reflect this change. Enhanced tests to verify the new functionality.
This commit is contained in:
1 parent
747e6e25e0
commit
bf661673c9
6 files changed
+71
-7
No files matched your search
@@ -137,21 +137,29 @@ describe('daily database backup', () => {
|
||||
expect(describeBackup(root, early)).toEqual({
|
||||
state: 'waiting',
|
||||
text: 'No database backup has been saved yet.',
|
||||
savedToday: false,
|
||||
});
|
||||
expect(describeBackup(root, due)).toEqual({
|
||||
state: 'behind',
|
||||
text: 'No database backup has been saved yet.',
|
||||
savedToday: false,
|
||||
});
|
||||
writeFileSync(path.join(root, 'daily-2026-06-14.db'), '');
|
||||
expect(describeBackup(root, early).text).toBe('Database backup saved June 14, 2026.');
|
||||
expect(describeBackup(root, early)).toEqual({
|
||||
state: 'saved',
|
||||
text: 'Database backup saved June 14, 2026.',
|
||||
savedToday: false,
|
||||
});
|
||||
expect(describeBackup(root, due)).toEqual({
|
||||
state: 'behind',
|
||||
text: 'Database backup is behind. The newest saved copy is June 14, 2026.',
|
||||
savedToday: false,
|
||||
});
|
||||
writeFileSync(path.join(root, 'daily-2026-06-15.db'), '');
|
||||
expect(describeBackup(root, due)).toEqual({
|
||||
state: 'saved',
|
||||
text: 'Database backup saved June 15, 2026.',
|
||||
savedToday: true,
|
||||
});
|
||||
expect(JSON.stringify(describeBackup(root, due))).not.toContain('/');
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user