Skip to content

Commit 234951d

Browse files
TabPanel: borders of nested TabPanels should be shown correctly in generic themes (T1280729) (DevExpress#29351)
1 parent 27ca162 commit 234951d

File tree

28 files changed

+214
-126
lines changed

28 files changed

+214
-126
lines changed

e2e/testcafe-devextreme/tests/navigation/tabPanel/common.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Item } from 'devextreme/ui/tab_panel.d';
88
import { testScreenshot } from '../../../helpers/themeUtils';
99
import url from '../../../helpers/getPageUrl';
1010
import { createWidget } from '../../../helpers/createWidget';
11-
import { setAttribute, appendElementTo } from '../../../helpers/domUtils';
11+
import { setAttribute, appendElementTo, insertStylesheetRulesToPage } from '../../../helpers/domUtils';
1212

1313
// const TABS_RIGHT_NAV_BUTTON_CLASS = 'dx-tabs-nav-button-right';
1414
// const TABS_LEFT_NAV_BUTTON_CLASS = 'dx-tabs-nav-button-left';
@@ -595,6 +595,60 @@ test('TabPanel borders without scrolling', async (t) => {
595595
});
596596
});
597597

598+
const positions = ['top', 'left', 'right', 'bottom'];
599+
600+
positions.forEach((tabsPosition) => {
601+
test(`TabPanel border appearance when it placed inside the content of TabPanel with=${tabsPosition}`, async (t) => {
602+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
603+
604+
await testScreenshot(t, takeScreenshot, `Nested TabPanel borders appearance,tabsPos=${tabsPosition}.png`, { element: '#container' });
605+
606+
await t
607+
.expect(compareResults.isValid())
608+
.ok(compareResults.errorMessages());
609+
}).before(async () => {
610+
await insertStylesheetRulesToPage('.dx-tabpanel { margin: 10px }');
611+
612+
const dataSource = [
613+
{
614+
title: 'John Heart',
615+
text: 'John Heart',
616+
}, {
617+
title: 'Olivia Peyton',
618+
text: 'Olivia Peyton',
619+
},
620+
] as Item[];
621+
622+
return createWidget('dxTabPanel', {
623+
dataSource,
624+
height: 700,
625+
width: 500,
626+
tabsPosition,
627+
selectedIndex: 1,
628+
deferRendering: true,
629+
itemTemplate: ClientFunction(() => {
630+
const $container = $('<div>');
631+
632+
positions.forEach((position) => {
633+
const $tabPanel = ($('<div>') as any).dxTabPanel({
634+
height: 120,
635+
tabsPosition: position,
636+
dataSource,
637+
});
638+
639+
$container.append($tabPanel);
640+
641+
$container.append($('<hr>'));
642+
});
643+
644+
return $container;
645+
}, {
646+
dependencies: { dataSource, positions },
647+
}),
648+
});
649+
});
650+
});
651+
598652
[true, false].forEach((rtlEnabled) => {
599653
['start', 'top', 'end', 'bottom'].forEach((iconPosition) => {
600654
test('TabPanel icon position', async (t) => {
Loading
22 KB
Loading
Loading
21.9 KB
Loading
22.2 KB
Loading
Loading
Loading
22.2 KB
Loading
Loading

0 commit comments

Comments
 (0)