diff --git a/packages/devextreme-angular/tests/src/core/component.spec.ts b/packages/devextreme-angular/tests/src/core/component.spec.ts index e71d5e3dee1c..e7b1afd83f27 100644 --- a/packages/devextreme-angular/tests/src/core/component.spec.ts +++ b/packages/devextreme-angular/tests/src/core/component.spec.ts @@ -25,6 +25,7 @@ import { WatcherHelper } from 'devextreme-angular'; +import config from 'devextreme/core/config'; // TODO: Try to replace dxButton to Widget ('require' required) import dxButton from 'devextreme/ui/button'; let DxTestWidget = dxButton; @@ -142,6 +143,10 @@ describe('DevExtreme Angular widget', () => { expect(element.classList).toContain('dx-test-widget'); }); + it('correctly sets the buy now link', () => { + expect(config().buyNowLink).toBe('https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeAngular.aspx'); + }); + it('should be disposed', () => { let testSpy = spyOn(TestContainerComponent.prototype, 'testMethod'); diff --git a/packages/devextreme-react/src/core/__tests__/component.test.tsx b/packages/devextreme-react/src/core/__tests__/component.test.tsx index 81b8a0c4ad7b..eb3a24cb2a8f 100644 --- a/packages/devextreme-react/src/core/__tests__/component.test.tsx +++ b/packages/devextreme-react/src/core/__tests__/component.test.tsx @@ -1,4 +1,5 @@ import * as events from 'devextreme/events'; +import config from 'devextreme/core/config'; import * as testingLib from '@testing-library/react'; import * as React from 'react'; import { useLayoutEffect } from 'react'; @@ -117,6 +118,10 @@ describe('rendering', () => { testingLib.render(); }); + + it('correctly sets the buy now link', () => { + expect(config().buyNowLink).toBe('https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeReact.aspx'); + }); }); describe('nested full components', () => { diff --git a/packages/devextreme-vue/src/core/__tests__/component.test.ts b/packages/devextreme-vue/src/core/__tests__/component.test.ts index e1b36391cffe..e7aa102164ff 100644 --- a/packages/devextreme-vue/src/core/__tests__/component.test.ts +++ b/packages/devextreme-vue/src/core/__tests__/component.test.ts @@ -1,6 +1,7 @@ import { PatchFlags } from '@vue/shared'; import { mount } from '@vue/test-utils'; import * as events from 'devextreme/events'; +import config from 'devextreme/core/config'; import { App, createVNode, defineComponent, h, nextTick, renderSlot, } from 'vue'; @@ -156,6 +157,10 @@ describe('component rendering', () => { expect(WidgetClass.mock.instances[1]).toEqual({}); }); + it('correctly sets the buy now link', () => { + expect(config().buyNowLink).toBe('https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeVue.aspx'); + }); + describe('options', () => { it('watch prop changing to undefined', (done) => { const wrapper = mount(TestComponent, { diff --git a/packages/devextreme/js/__internal/core/license/license_validation.test.ts b/packages/devextreme/js/__internal/core/license/license_validation.test.ts index 1c5bd8853347..4159f11009f3 100644 --- a/packages/devextreme/js/__internal/core/license/license_validation.test.ts +++ b/packages/devextreme/js/__internal/core/license/license_validation.test.ts @@ -1,3 +1,4 @@ +import config from '@js/core/config'; import errors from '@js/core/errors'; import { base } from '../../ui/overlay/m_z_index'; @@ -364,6 +365,17 @@ describe('license check', () => { expect(trialPanelSpy).not.toHaveBeenCalled(); }); + test('Trial panel "Buy Now" link must use the jQuery link if no config has been set', () => { + validateLicense('', '1.2'); + expect(trialPanelSpy?.mock.calls[0][0]).toBe('https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeJQuery.aspx'); + }); + + test('Trial panel "Buy Now" link must use the value from the config', () => { + config({ buyNowLink: 'trial-panel-link.com' }); + validateLicense('', '1.2'); + expect(trialPanelSpy?.mock.calls[0][0]).toBe('trial-panel-link.com'); + }); + test('Message should be logged only once', () => { validateLicense('', '1.0'); validateLicense('', '1.0');