Skip to content

Commit

Permalink
test: License v3 - add test cases for empty limitations (#30695)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Oct 20, 2023
1 parent c29f5ff commit febc716
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ee/packages/license/src/license.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ it('should not prevent if the counter is under the limit', async () => {
await expect(licenseManager.shouldPreventAction('activeUsers')).resolves.toBe(false);
});

it('should not prevent actions if there is no limit set in the license', async () => {
const licenseManager = await getReadyLicenseManager();

const license = await new MockedLicenseBuilder();

await expect(licenseManager.setLicense(await license.sign())).resolves.toBe(true);

licenseManager.setLicenseLimitCounter('activeUsers', () => 5);
licenseManager.setLicenseLimitCounter('monthlyActiveContacts', () => 5);
await expect(licenseManager.shouldPreventAction('activeUsers')).resolves.toBe(false);
await expect(licenseManager.shouldPreventAction('monthlyActiveContacts')).resolves.toBe(false);
});

it('should prevent if the counter is equal or over the limit', async () => {
const licenseManager = await getReadyLicenseManager();

Expand Down

0 comments on commit febc716

Please sign in to comment.