devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
34 lines (33 loc) • 1.39 kB
JavaScript
/**
* DevExtreme (cjs/__internal/core/license/license_validation.server.test.js)
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
var _globals = require("@jest/globals");
var _license_validation = require("./license_validation");
(0, _globals.describe)("license token", (() => {
(0, _globals.beforeEach)((() => {
(0, _license_validation.setLicenseCheckSkipCondition)(false)
}));
(0, _globals.afterEach)((() => {
_globals.jest.restoreAllMocks()
}));
(0, _globals.test)("API inside trial_panel should not be triggered on the server", (() => {
(0, _globals.expect)((() => (0, _license_validation.validateLicense)("", "1.0.4"))).not.toThrow()
}));
(0, _globals.test)("API inside trial_panel should not be triggered in Angular, where HTMLElement is mocked", (() => {
if (global.HTMLElement) {
throw Error("Wrong environment for this test!")
}
try {
global.HTMLElement = Symbol("HTMLElement mock");
(0, _globals.expect)((() => (0, _license_validation.validateLicense)("", "1.0.4"))).not.toThrow()
} finally {
delete global.HTMLElement
}
}))
}));