Skip to content

Commit

Permalink
test: ShouldPreventAction (#30690)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman authored Oct 19, 2023
1 parent b85df55 commit b9a3381
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ee/packages/license/src/license.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ it('should prevent if the counter is equal or over the limit', async () => {
await expect(licenseManager.shouldPreventAction('activeUsers')).resolves.toBe(true);
});

it.skip('should not prevent an action if another limit is over the limit', async () => {
const licenseManager = await getReadyLicenseManager();

const license = await new MockedLicenseBuilder()
.withLimits('activeUsers', [
{
max: 10,
behavior: 'prevent_action',
},
])
.withLimits('monthlyActiveContacts', [
{
max: 10,
behavior: 'prevent_action',
},
]);

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

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

describe('Validate License Limits', () => {
describe('prevent_action behavior', () => {
describe('during the licensing apply', () => {
Expand Down

0 comments on commit b9a3381

Please sign in to comment.