@@ -8,7 +8,7 @@ import { Item } from 'devextreme/ui/tab_panel.d';
88import { testScreenshot } from '../../../helpers/themeUtils' ;
99import url from '../../../helpers/getPageUrl' ;
1010import { 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 ) => {
0 commit comments