UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

43 lines (42 loc) 1.31 kB
/** * DevExtreme (esm/__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/ */ import { afterEach, beforeEach, describe, expect, jest, test } from "@jest/globals"; import { setLicenseCheckSkipCondition, validateLicense } from "./license_validation"; describe("license token", (() => { beforeEach((() => { setLicenseCheckSkipCondition(false) })); afterEach((() => { jest.restoreAllMocks() })); test("API inside trial_panel should not be triggered on the server", (() => { expect((() => validateLicense("", "1.0.4"))).not.toThrow() })); 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"); expect((() => validateLicense("", "1.0.4"))).not.toThrow() } finally { delete global.HTMLElement } })) }));