-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: wrong limits displayed on the UI
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { LicenseImp } from '.'; | ||
import { MockedLicenseBuilder, getReadyLicenseManager } from '../__tests__/MockedLicenseBuilder'; | ||
import { getAppsConfig } from './deprecated'; | ||
|
||
describe('Marketplace Restrictions', () => { | ||
it('should respect the default if there is no license applied', async () => { | ||
const LicenseManager = new LicenseImp(); | ||
|
||
expect(getAppsConfig.call(LicenseManager)).toEqual({ | ||
maxPrivateApps: 3, | ||
maxMarketplaceApps: 5, | ||
}); | ||
}); | ||
|
||
it('should return unlimited if there is license but no limits', async () => { | ||
const licenseManager = await getReadyLicenseManager(); | ||
|
||
const license = await new MockedLicenseBuilder(); | ||
|
||
await expect(licenseManager.setLicense(await license.sign())).resolves.toBe(true); | ||
|
||
await expect(getAppsConfig.call(licenseManager)).toEqual({ | ||
maxPrivateApps: -1, | ||
maxMarketplaceApps: -1, | ||
}); | ||
}); | ||
}); |