Improved test coverage for limit-service module

no issue

- The aim is to achieve 100% unit test coverage for servies and small modules. This change covers few more bases brining limit-service's module coverage from 80% to 94%.
This commit is contained in:
Naz 2021-10-25 18:18:04 +04:00
parent 8520c8a746
commit c8d840c211

View File

@ -304,6 +304,22 @@ describe('Limit Service', function () {
(await limitService.checkIfAnyOverLimit()).should.be.false();
});
it('Returns nothing if limit is not configured', async function () {
const limitService = new LimitService();
const isOverLimitResult = await limitService.checkIsOverLimit('unlimited');
should.equal(isOverLimitResult, undefined);
const wouldGoOverLimitResult = await limitService.checkWouldGoOverLimit('unlimited');
should.equal(wouldGoOverLimitResult, undefined);
const errorIfIsOverLimitResult = await limitService.errorIfIsOverLimit('unlimited');
should.equal(errorIfIsOverLimitResult, undefined);
const errorIfWouldGoOverLimitResult = await limitService.errorIfWouldGoOverLimit('unlimited');
should.equal(errorIfWouldGoOverLimitResult, undefined);
});
it('Throws an error when an allowlist limit is checked', async function () {
const limitService = new LimitService();