Skip to content

Commit

Permalink
Add support for internal key usage for Hot (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
budnix committed Apr 20, 2020
1 parent a0d378a commit 1f11e07
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/licenseKeyValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function checkLicenseKeyValidity(licenseKey: string): LicenseKeyValidityS
vars: {},
}

if (licenseKey === 'non-commercial-and-evaluation' || licenseKey === 'agpl-v3') {
if (licenseKey === 'non-commercial-and-evaluation' || licenseKey === 'agpl-v3' || licenseKey === 'internal-use-in-handsontable') {
messageDescriptor.template = LicenseKeyValidityState.VALID

} else if (typeof licenseKey === 'string' && checkKeySchema(licenseKey)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* The license key message is printed only once per window/process env.
* Jest provides complete isolation between files only. That is why the test
* contains only one case about "console.warn" message.
*/
import {HyperFormula} from '../../../src'

describe('license key', () => {
it('should not warn a message about invalid key when "internal-use-in-handsontable" is used', () => {
spyOn(console, 'warn')

HyperFormula.buildEmpty({
licenseKey: 'internal-use-in-handsontable',
})

expect(console.warn).not.toHaveBeenCalled()
})
})

0 comments on commit 1f11e07

Please sign in to comment.