@@ -2688,6 +2688,40 @@ QUnit.module('Supported editors', () => {
26882688 assert . deepEqual ( layoutManager . option ( 'layoutData.noRange' ) , [ 2 , 6 ] , 'data updated' ) ;
26892689 } ) ;
26902690
2691+ test ( 'RangeSlider should be rendered with passed name attributes for startName and endName inputs (T1256743)' , function ( assert ) {
2692+ const layoutManager = $ ( '#container' ) . dxLayoutManager ( {
2693+ layoutData : {
2694+ range : [ 10 , 20 ]
2695+ } ,
2696+ items : [ {
2697+ dataField : 'CustomRange' ,
2698+ editorType : 'dxRangeSlider' ,
2699+ editorOptions : {
2700+ startName : 'RangeStart' ,
2701+ endName : 'RangeEnd'
2702+ }
2703+ } ]
2704+ } ) . dxLayoutManager ( 'instance' ) ;
2705+
2706+ assert . deepEqual ( layoutManager . getEditor ( 'CustomRange' ) . option ( 'startName' ) , 'RangeStart' , 'startName specified correctly' ) ;
2707+ assert . deepEqual ( layoutManager . getEditor ( 'CustomRange' ) . option ( 'endName' ) , 'RangeEnd' , 'endName specified correctly' ) ;
2708+ } ) ;
2709+
2710+ test ( 'RangeSlider inputs should be rendered with predefined name attributes if startName and endName are not specified (T1256743)' , function ( assert ) {
2711+ const layoutManager = $ ( '#container' ) . dxLayoutManager ( {
2712+ layoutData : {
2713+ range : [ 10 , 20 ]
2714+ } ,
2715+ items : [ {
2716+ dataField : 'CustomRange' ,
2717+ editorType : 'dxRangeSlider'
2718+ } ]
2719+ } ) . dxLayoutManager ( 'instance' ) ;
2720+
2721+ assert . deepEqual ( layoutManager . getEditor ( 'CustomRange' ) . option ( 'startName' ) , 'CustomRangeStart' , 'startName specified correctly' ) ;
2722+ assert . deepEqual ( layoutManager . getEditor ( 'CustomRange' ) . option ( 'endName' ) , 'CustomRangeEnd' , 'endName specified correctly' ) ;
2723+ } ) ;
2724+
26912725 test ( 'Render DateRangeBox' , function ( assert ) {
26922726 const layoutManager = $ ( '#container' ) . dxLayoutManager ( {
26932727 layoutData : {
@@ -2710,6 +2744,40 @@ QUnit.module('Supported editors', () => {
27102744 assert . deepEqual ( layoutManager . option ( 'layoutData.noRange' ) , newRangeValue , 'data updated' ) ;
27112745 } ) ;
27122746
2747+ test ( 'DateRangeBox should be rendered with passed name attributes for startDateName and endDateName inputs (T1256743)' , function ( assert ) {
2748+ const layoutManager = $ ( '#container' ) . dxLayoutManager ( {
2749+ layoutData : {
2750+ range : [ new Date ( 2021 , 9 , 17 ) , new Date ( 2021 , 9 , 25 ) ]
2751+ } ,
2752+ items : [ {
2753+ dataField : 'DateRange' ,
2754+ editorType : 'dxDateRangeBox' ,
2755+ editorOptions : {
2756+ startDateName : 'RangeStart' ,
2757+ endDateName : 'RangeEnd'
2758+ }
2759+ } ]
2760+ } ) . dxLayoutManager ( 'instance' ) ;
2761+
2762+ assert . deepEqual ( layoutManager . getEditor ( 'DateRange' ) . option ( 'startDateName' ) , 'RangeStart' , 'startDateName specified correctly' ) ;
2763+ assert . deepEqual ( layoutManager . getEditor ( 'DateRange' ) . option ( 'endDateName' ) , 'RangeEnd' , 'endDateName specified correctly' ) ;
2764+ } ) ;
2765+
2766+ test ( 'DateRangeBox inputs should be rendered with predefined name attributes if startDateName and endDateName are not specified (T1256743)' , function ( assert ) {
2767+ const layoutManager = $ ( '#container' ) . dxLayoutManager ( {
2768+ layoutData : {
2769+ range : [ new Date ( 2021 , 9 , 17 ) , new Date ( 2021 , 9 , 25 ) ]
2770+ } ,
2771+ items : [ {
2772+ dataField : 'DateRange' ,
2773+ editorType : 'dxDateRangeBox'
2774+ } ]
2775+ } ) . dxLayoutManager ( 'instance' ) ;
2776+
2777+ assert . deepEqual ( layoutManager . getEditor ( 'DateRange' ) . option ( 'startDateName' ) , 'DateRangeStart' , 'startDateName specified correctly' ) ;
2778+ assert . deepEqual ( layoutManager . getEditor ( 'DateRange' ) . option ( 'endDateName' ) , 'DateRangeEnd' , 'endDateName specified correctly' ) ;
2779+ } ) ;
2780+
27132781 test ( 'Form with dxRadioGroup that items are defined via \'dataSource\' option renders without error' , function ( assert ) {
27142782 const $testContainer = $ ( '#container' ) ;
27152783 let errorMessage ;
0 commit comments