Skip to content

Commit

Permalink
Fix buy link test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rochmar Nicolas (DevExpress) committed Jun 14, 2024
1 parent f6146c8 commit cdb94c7
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import config from '@js/core/config';
import errors from '@js/core/errors';

import { base } from '../../ui/overlay/m_z_index';
Expand Down Expand Up @@ -274,7 +275,7 @@ describe('version mismatch', () => {
});
});

describe('license check', () => {
describe.only('license check', () => {
const TOKEN_23_1 = 'ewogICJmb3JtYXQiOiAxLAogICJjdXN0b21lcklkIjogImIxMTQwYjQ2LWZkZTEtNDFiZC1hMjgwLTRkYjlmOGU3ZDliZCIsCiAgIm1heFZlcnNpb25BbGxvd2VkIjogMjMxCn0=.DiDceRbil4IzXl5av7pNkKieyqHHhRf+CM477zDu4N9fyrhkQsjRourYvgVfkbSm+EQplkXhlMBc3s8Vm9n+VtPaMbeWXis92cdW/6HiT+Dm54xw5vZ5POGunKRrNYUzd9zTbYcz0bYA/dc/mHFeUdXA0UlKcx1uMaXmtJrkK74=';
const TOKEN_23_2 = 'ewogICJmb3JtYXQiOiAxLAogICJjdXN0b21lcklkIjogIjYxMjFmMDIyLTFjMTItNDNjZC04YWE0LTkwNzJkNDU4YjYxNCIsCiAgIm1heFZlcnNpb25BbGxvd2VkIjogMjMyCn0=.RENyZ3Ga5rCB7/XNKYbk2Ffv1n9bUexYNhyOlqcAD02YVnPw6XyQcN+ZORScKDU9gOInJ4o7vPxkgh10KvMZNn+FuBK8UcUR7kchk7z0CHGuOcIn2jD5X2hG6SYJ0UCBG/JDG35AL09T7Uv/pGj4PolRsANxtuMpoqmvX2D2vkU=';
const TOKEN_UNVERIFIED = 'ewogICJmb3JtYXQiOiAxLAogICJjdXN0b21lcklkIjogImIxMTQwYjQ2LWZkZTEtNDFiZC1hMjgwLTRkYjlmOGU3ZDliZCIsCiAgIm1heFZlcnNpb25BbGxvd2VkIjogMjMxCn0=.NVsilC5uWlD5QGS6bocLMlsVVK0VpZXYwU2DstUiLRpEI79/onuR8dGWasCLBo4PORDHPkNA/Ej8XeCHzJ0EkXRRZ7E2LrP/xlEfHRXTruvW4IEbZt3LiwJBt6/isLz+wzXtYtjV7tpE07/Y0TFoy+mWpHoU11GVtwKh6weRxkg=';
Expand Down Expand Up @@ -364,18 +365,17 @@ describe('license check', () => {
expect(trialPanelSpy).not.toHaveBeenCalled();
});

test.each([
{ token: '', version: '1.0.3' },
{ token: null, version: '1.0.4' },
{ token: undefined, version: '1.0.50' },
{ token: '', version: '1.0.0' },
{ token: null, version: '1.2.4-preview' },
{ token: undefined, version: '1.2' },
])('Buy now link is set correctly', ({ token, version }) => {
validateLicense(token as string, version);
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');
Expand Down

0 comments on commit cdb94c7

Please sign in to comment.