UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

43 lines (42 loc) 1.29 kB
/** * DevExtreme (esm/__internal/core/license/license_validation.server.test.js) * Version: 25.2.7 * Build date: Tue May 05 2026 * * Copyright (c) 2012 - 2026 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 } }) });