diff --git a/packages/contentstack-config/test/unit/commands/rate-limit.test.ts b/packages/contentstack-config/test/unit/commands/rate-limit.test.ts index 8f0a1e8685..f38d4e5821 100644 --- a/packages/contentstack-config/test/unit/commands/rate-limit.test.ts +++ b/packages/contentstack-config/test/unit/commands/rate-limit.test.ts @@ -92,8 +92,13 @@ describe('Rate Limit Commands', () => { }, }); const config = { org: 'test-org-id', utilize: ['70'], 'limit-name': ['getLimit'] }; - await handler.setRateLimit(config); - expect(errorMessage).to.include('Error: Unable to set the rate limit'); + try { + await handler.setRateLimit(config); + expect.fail('Expected an error to be thrown'); + } catch (error) { + expect(error).to.be.an('error'); + expect(error.message).to.equal('Error: Client Error'); + } }); it('Set Rate Limit: should handle unauthenticated user', async () => { @@ -137,7 +142,10 @@ describe('Rate Limit Commands', () => { it('Get Rate Limit: should print the rate limit for the given organization', async () => { configHandler.set('rateLimit', rateLimit); await GetRateLimitCommand.run(['--org', 'test-org-id']); - expect(printMessage).to.include(' test-org-id 10(70%) 0 1(80%) '); + expect(printMessage).to.include('test-org-id'); + expect(printMessage).to.include('10(70%)'); + expect(printMessage).to.include('0'); + expect(printMessage).to.include('1(80%)'); }); it('Get Rate Limit: should throw an error if the organization is not found', async () => {