From 8c6ec8b2144766fc28658333e75b27b8ed5bb264 Mon Sep 17 00:00:00 2001 From: Thibaut Patel Date: Thu, 8 Apr 2021 15:07:30 +0200 Subject: [PATCH] Added a test to confirm `isLimited` behavior of an unkown key no issue --- ghost/limit-service/test/limit-service.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ghost/limit-service/test/limit-service.test.js b/ghost/limit-service/test/limit-service.test.js index e79449c807..282c625901 100644 --- a/ghost/limit-service/test/limit-service.test.js +++ b/ghost/limit-service/test/limit-service.test.js @@ -126,6 +126,19 @@ describe('Limit Service', function () { limitService.isLimited('custom_themes').should.be.true(); limitService.isLimited('customThemes').should.be.true(); }); + + it('answers correctly when no limits are provided', function () { + const limitService = new LimitService(); + + let limits = {}; + + limitService.loadLimits({limits, errors}); + + limitService.isLimited('staff').should.be.false(); + limitService.isLimited('members').should.be.false(); + limitService.isLimited('custom_themes').should.be.false(); + limitService.isLimited('customThemes').should.be.false(); + }); }); describe('Custom limit count query configuration', function () {