Skip to content

Commit 5df9b82

Browse files
Merge branch '25_2' into 25_2_reduce_runners
2 parents 27e7f21 + e8ddaf0 commit 5df9b82

File tree

8 files changed

+111
-56
lines changed

8 files changed

+111
-56
lines changed

e2e/testcafe-devextreme/tests/dataGrid/common/keyboardNavigation/keyboardNavigation.functional.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,23 +2605,6 @@ test('Empty row should lose focus on Tab (T941246)', async (t) => {
26052605
}
26062606

26072607
await checkNavigationOfAllCells();
2608-
2609-
await t
2610-
.pressKey('tab');
2611-
2612-
const $buttonElement = isCommandColumnFixed
2613-
? dataGrid.getFixedDataRow(1).getCommandCell(2).getButton(0)
2614-
: dataGrid.getDataRow(1).getCommandCell(2).getButton(0);
2615-
2616-
await t
2617-
.expect($buttonElement.focused)
2618-
.notOk()
2619-
.pressKey('shift+tab')
2620-
.expect($buttonElement.focused)
2621-
.ok()
2622-
.pressKey('shift+tab')
2623-
.expect(dataGrid.getDataCell(1, 1).element.focused)
2624-
.ok();
26252608
}).before(async () => {
26262609
await createWidget('dxDataGrid', {
26272610
dataSource: [

e2e/testcafe-devextreme/tests/dataGrid/common/scrolling.ts

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,34 +1833,31 @@ test('DataGrid - The "row" parameter in the FocusedRowChanged event refers to a
18331833
[true, false].forEach((nativeScroll) => {
18341834
type TestCaseWindow = typeof window & { dataGridScrollableEventValues?: number[] };
18351835

1836-
test(
1837-
`Should not scroll back on top with virtual scrolling and adaptive master detail (nativeScroll: ${nativeScroll}) [T1278804]`,
1838-
async (t) => {
1839-
// NOTE: idx + 1 logic inside POM
1840-
const adaptiveCellIdx = 101;
1841-
const scrollValuesThreshold = 100;
1842-
1843-
const dataGrid = new DataGrid('#container');
1844-
const firstRow = dataGrid.getDataRow(0);
1845-
const firstDataCell = firstRow.getDataCell(0);
1846-
const adaptiveCell = firstRow.getCommandCell(adaptiveCellIdx);
1836+
test.meta({ unstable: true })(`Should not scroll back on top with virtual scrolling and adaptive master detail (nativeScroll: ${nativeScroll}) [T1278804]`, async (t) => {
1837+
// NOTE: idx + 1 logic inside POM
1838+
const adaptiveCellIdx = 101;
1839+
const scrollValuesThreshold = 100;
18471840

1848-
await t
1849-
.click(firstDataCell.element)
1850-
.click(adaptiveCell.element);
1841+
const dataGrid = new DataGrid('#container');
1842+
const firstRow = dataGrid.getDataRow(0);
1843+
const firstDataCell = firstRow.getDataCell(0);
1844+
const adaptiveCell = firstRow.getCommandCell(adaptiveCellIdx);
1845+
1846+
await t
1847+
.click(firstDataCell.element)
1848+
.click(adaptiveCell.element);
18511849

1852-
await dataGrid
1853-
.scrollBy(t, { y: 1000 });
1854-
await dataGrid
1855-
.scrollBy(t, { y: 1000 });
1850+
await dataGrid
1851+
.scrollBy(t, { y: 1000 });
1852+
await dataGrid
1853+
.scrollBy(t, { y: 1000 });
18561854

1857-
const scrollOffsets = await t
1858-
.eval(() => (window as TestCaseWindow).dataGridScrollableEventValues) as number[];
1855+
const scrollOffsets = await t
1856+
.eval(() => (window as TestCaseWindow).dataGridScrollableEventValues) as number[];
18591857

1860-
const hasSmallScrollValues = scrollOffsets.some((offset) => offset < scrollValuesThreshold);
1861-
await t.expect(hasSmallScrollValues).notOk();
1862-
},
1863-
).before(async () => {
1858+
const hasSmallScrollValues = scrollOffsets.some((offset) => offset < scrollValuesThreshold);
1859+
await t.expect(hasSmallScrollValues).notOk();
1860+
}).before(async () => {
18641861
await createWidget('dxDataGrid', {
18651862
dataSource: getData(3, 100).map((item, idx) => ({ ...item, id: idx })),
18661863
keyExpr: 'id',
16 Bytes
Loading

e2e/testcafe-devextreme/tests/editors/textBox/validationMessage.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const TEXTEDITOR_INPUT_CLASS = 'dx-texteditor-input';
1212
fixture.disablePageReloads`ValidationMessage`
1313
.page(url(__dirname, '../../container.html'));
1414

15-
test.meta({ browserSize: [300, 200] })('Validation Message position should be correct after change visibility of parent container (T1095900)', async (t) => {
15+
test.meta({ browserSize: [600, 600] })('Validation Message position should be correct after change visibility of parent container (T1095900)', async (t) => {
1616
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
1717

1818
addFocusableElementBefore('#container');
@@ -21,7 +21,8 @@ test.meta({ browserSize: [300, 200] })('Validation Message position should be co
2121
.click(Selector(`.${TEXTEDITOR_INPUT_CLASS}`))
2222
.pressKey('backspace')
2323
.pressKey('enter')
24-
.pressKey('tab');
24+
.pressKey('tab')
25+
.wait(500);
2526

2627
await setAttribute('#container', 'hidden', 'true');
2728
await removeAttribute('#container', 'hidden');

e2e/testcafe-devextreme/tests/scheduler/common/header/header_material.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@ import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
33
import Scheduler from 'devextreme-testcafe-models/scheduler';
44
import { createWidget } from '../../../../helpers/createWidget';
55
import url from '../../../../helpers/getPageUrl';
6-
import { testScreenshot } from '../../../../helpers/themeUtils';
6+
import { isMaterial, isMaterialBased, testScreenshot } from '../../../../helpers/themeUtils';
77

88
fixture.disablePageReloads`Scheduler header: material theme`
99
.page(url(__dirname, '../../../container.html'));
1010

1111
// visual: material.blue.light
12-
test('dateNavigator buttons should have "text" styling mode with material theme', async (t) => {
12+
test('dateNavigator buttons should have "text" styling mode', async (t) => {
1313
const { toolbar } = new Scheduler('#container');
1414

15+
const expectedClass = isMaterialBased() ? 'dx-button-mode-text' : 'dx-button-mode-contained';
16+
1517
await t
16-
.expect(toolbar.navigator.prevButton.hasClass('dx-button-mode-text'))
18+
.expect(toolbar.navigator.prevButton.hasClass(expectedClass))
1719
.ok()
1820

19-
.expect(toolbar.navigator.caption.hasClass('dx-button-mode-text'))
21+
.expect(toolbar.navigator.caption.hasClass(expectedClass))
2022
.ok()
2123

22-
.expect(toolbar.navigator.nextButton.hasClass('dx-button-mode-text'))
24+
.expect(toolbar.navigator.nextButton.hasClass(expectedClass))
2325
.ok();
2426
}).before(async () => createWidget('dxScheduler', {
2527
currentView: 'day',
@@ -36,7 +38,7 @@ test('viewSwitcher dropdown button popup should have a specified class', async (
3638
await t
3739
.click(dropDownButton.element)
3840
.expect(Selector(viewSwitcherDropDownButtonContent).count)
39-
.eql(1);
41+
.eql(isMaterial() ? 1 : 0);
4042
}).before(async () => createWidget('dxScheduler', {
4143
currentView: 'day',
4244
views: ['day', 'week'],
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* @jest-environment jsdom
3+
*/
4+
import {
5+
beforeEach, describe, expect, it,
6+
} from '@jest/globals';
7+
8+
import { renderTrialPanel } from './trial_panel.client';
9+
10+
describe('trial panel client', () => {
11+
beforeEach(() => {
12+
document.body.innerHTML = '';
13+
});
14+
15+
it('should not display subscription text when subscriptions parameter is empty string', () => {
16+
renderTrialPanel(
17+
'https://example.com/buy',
18+
'https://example.com/docs',
19+
'25.2.0',
20+
'',
21+
);
22+
23+
const triggerElement = document.querySelector('dx-license-trigger');
24+
expect(triggerElement).not.toBeNull();
25+
26+
const panelElement = document.querySelector('dx-license');
27+
if (panelElement) {
28+
const text = panelElement.textContent ?? '';
29+
expect(text).not.toContain('Included in Subscriptions:');
30+
}
31+
});
32+
33+
it('should set subscriptions attribute when parameter is a valid string', () => {
34+
renderTrialPanel(
35+
'https://example.com/buy',
36+
'https://example.com/docs',
37+
'25.2.0',
38+
'Universal, DXperience',
39+
);
40+
41+
const triggerElement = document.querySelector('dx-license-trigger');
42+
expect(triggerElement).not.toBeNull();
43+
44+
const subscriptionsAttr = triggerElement?.getAttribute('subscriptions');
45+
expect(subscriptionsAttr).toBe('Universal, DXperience');
46+
});
47+
48+
it('should not display subscription text when subscriptions parameter is actual null', () => {
49+
renderTrialPanel(
50+
'https://example.com/buy',
51+
'https://example.com/docs',
52+
'25.2.0',
53+
null as any, // Actual null value
54+
);
55+
56+
const triggerElement = document.querySelector('dx-license-trigger');
57+
expect(triggerElement).not.toBeNull();
58+
59+
// When null is passed, it gets converted to string "null" as HTML attribute
60+
const subscriptionsAttr = triggerElement?.getAttribute('subscriptions');
61+
expect(subscriptionsAttr).toBe('');
62+
63+
// Ensure the panel element doesn't show "Included in Subscriptions: null"
64+
// This is the key test - our fix should prevent displaying "null"
65+
const panelElement = document.querySelector('dx-license');
66+
if (panelElement) {
67+
const text = panelElement.textContent ?? '';
68+
expect(text).not.toContain('Included in Subscriptions: null');
69+
}
70+
});
71+
});

packages/devextreme/js/__internal/core/license/trial_panel.client.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,11 @@ class DxLicenseTrigger extends SafeHTMLElement {
304304
const license = document.createElement(componentNames.panel);
305305

306306
Object.values(attributeNames).forEach((attrName) => {
307-
license.setAttribute(
308-
attrName,
309-
this.getAttribute(attrName) as string,
310-
);
307+
const attrValue = this.getAttribute(attrName);
308+
309+
if (attrValue) {
310+
license.setAttribute(attrName, attrValue);
311+
}
311312
});
312313

313314
license.setAttribute(DATA_PERMANENT_ATTRIBUTE, '');
@@ -338,7 +339,7 @@ export function renderTrialPanel(
338339
buyNowUrl: string,
339340
licensingDocUrl: string,
340341
version: string,
341-
subscriptions = '',
342+
subscriptions: string | undefined | null,
342343
customStyles?: CustomTrialPanelStyles,
343344
): void {
344345
registerCustomComponents(customStyles);
@@ -348,7 +349,7 @@ export function renderTrialPanel(
348349
trialPanelTrigger.setAttribute(attributeNames.buyNow, buyNowUrl);
349350
trialPanelTrigger.setAttribute(attributeNames.licensingDoc, licensingDocUrl);
350351
trialPanelTrigger.setAttribute(attributeNames.version, version);
351-
trialPanelTrigger.setAttribute(attributeNames.subscriptions, subscriptions);
352+
trialPanelTrigger.setAttribute(attributeNames.subscriptions, subscriptions ?? '');
352353

353354
document.body.appendChild(trialPanelTrigger);
354355
}

packages/devextreme/js/__internal/core/license/trial_panel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function showTrialPanel(
99
buyNowUrl: string,
1010
licensingDocUrl: string,
1111
version: string,
12-
subscriptions?: string,
12+
subscriptions?: string | null,
1313
customStyles?: CustomTrialPanelStyles,
1414
): void {
1515
if (isClient()) {

0 commit comments

Comments
 (0)