diff --git a/src/test/backups-test.js b/src/test/backups-test.js index 6ae2d946c..35401ac80 100644 --- a/src/test/backups-test.js +++ b/src/test/backups-test.js @@ -115,20 +115,22 @@ describe('retention policy', function () { expect(b[3].keepReason).to.be(undefined); }); - it('2 daily, 6 monthly, 1 yearly', function () { + it('2 daily, 3 monthly, 1 yearly', function () { let b = [ { 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: '5', creationTime: moment().subtract(10, 'd').toDate() } + { id: '4', creationTime: moment().subtract(32, 'd').toDate() }, + { id: '5', creationTime: moment().subtract(63, 'd').toDate() }, + { id: '6', creationTime: moment().subtract(65, 'd').toDate() }, ]; - backups._applyBackupRetentionPolicy(b, { keepDaily: 2, keepMonthly: 6, keepYearly: 1 }); + backups._applyBackupRetentionPolicy(b, { keepDaily: 2, keepMonthly: 3, 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('keepMonthly'); - expect(b[4].keepReason).to.be('keepYearly'); + expect(b[4].keepReason).to.be('keepMonthly'); + expect(b[5].keepReason).to.be('keepYearly'); }); });