Fix backup retention tests

This commit is contained in:
Johannes Zellner
2020-06-04 13:43:25 +02:00
parent 7c5ff5e4d5
commit 8994ac3727

View File

@@ -121,13 +121,15 @@ describe('retention policy', function () {
{ id: '1', creationTime: moment().toDate() },
{ id: '2', creationTime: moment().subtract(3, 'h').toDate() },
{ id: '3', creationTime: moment().subtract(26, 'h').toDate() },
{ id: '4', creationTime: moment().subtract(5, 'd').toDate() }
{ id: '4', creationTime: moment().subtract(5, 'd').toDate() },
{ id: '5', creationTime: moment().subtract(10, 'd').toDate() }
];
backups._applyBackupRetentionPolicy(b, { keepDaily: 2, keepMonthly: 6, keepYearly: 1 });
expect(b[0].keepReason).to.be('keepDaily'); // today
expect(b[1].keepReason).to.be('keepMonthly');
expect(b[2].keepReason).to.be('keepDaily'); // yesterday
expect(b[3].keepReason).to.be('keepYearly');
expect(b[3].keepReason).to.be('keepMonthly');
expect(b[4].keepReason).to.be('keepYearly');
});
});