@@ -16,67 +16,67 @@ const stylingModes = ['outlined', 'underlined', 'filled'];
1616fixture . disablePageReloads `DateBox_Label`
1717 . page ( url ( __dirname , '../../container.html' ) ) ;
1818
19- stylingModes . forEach ( ( stylingMode ) => {
20- test ( `Symbol parts in label should not be cropped with stylingMode=${ stylingMode } ` , async ( t ) => {
21- const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
19+ test ( 'Symbol parts in label should not be cropped' , async ( t ) => {
20+ const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
2221
23- await testScreenshot ( t , takeScreenshot , ` Datebox label symbols with stylingMode= ${ stylingMode } .png` , { element : '#container' } ) ;
22+ await testScreenshot ( t , takeScreenshot , ' Datebox label symbols.png' , { element : '#container' } ) ;
2423
25- await t
26- . expect ( compareResults . isValid ( ) )
27- . ok ( compareResults . errorMessages ( ) ) ;
28- } ) . before ( async ( ) => {
29- await appendElementTo ( '#container' , 'div' , 'dateBox' ) ;
30- await setStyleAttribute ( Selector ( '#container' ) , 'box-sizing: border-box; width: 300px; height: 400px; padding: 8px;' ) ;
24+ await t
25+ . expect ( compareResults . isValid ( ) )
26+ . ok ( compareResults . errorMessages ( ) ) ;
27+ } ) . before ( async ( ) => {
28+ await appendElementTo ( '#container' , 'div' , 'dateBox' ) ;
29+ await setStyleAttribute ( Selector ( '#container' ) , 'box-sizing: border-box; width: 300px; height: 400px; padding: 8px;' ) ;
3130
32- return createWidget ( 'dxDateBox' , {
33- label : 'qwerty QWERTY 1234567890' ,
31+ for ( const stylingMode of stylingModes ) {
32+ const id = `${ `dx${ new Guid ( ) } ` } ` ;
33+
34+ await appendElementTo ( '#container' , 'div' , id , { } ) ;
35+
36+ const options : any = {
37+ width : 220 ,
38+ label : 'label text' ,
3439 stylingMode,
35- value : new Date ( 1900 , 0 , 1 ) ,
36- } , '#dateBox' ) ;
37- } ) ;
40+ showClearButton : true ,
41+ value : new Date ( 2021 , 9 , 17 , 16 , 34 ) ,
42+ } ;
43+
44+ await createWidget ( 'dxDateBox' , options , `#${ id } ` ) ;
45+ }
3846} ) ;
3947
40- [ true , false ] . forEach ( ( isValid ) => {
41- test ( `DateBox with buttons container, isValid=${ isValid } ` , async ( t ) => {
42- const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
43-
44- await insertStylesheetRulesToPage ( `#container { display: flex; flex-wrap: wrap; } .${ DATEBOX_CLASS } { width: 220px; margin: 2px; }` ) ;
45-
46- await testScreenshot ( t , takeScreenshot , `DateBox render with buttons container, isValid=${ isValid } .png` , { shouldTestInCompact : true } ) ;
47-
48- await removeStylesheetRulesFromPage ( ) ;
49-
50- await t
51- . expect ( compareResults . isValid ( ) )
52- . ok ( compareResults . errorMessages ( ) ) ;
53- } ) . before ( async ( ) => {
54- for ( const stylingMode of stylingModes ) {
55- for ( const buttons of [
56- [ 'clear' ] ,
57- [ 'clear' , 'dropDown' ] ,
58- [ { name : 'custom' , location : 'after' , options : { icon : 'home' } } , 'clear' , 'dropDown' ] ,
59- [ 'clear' , { name : 'custom' , location : 'after' , options : { icon : 'home' } } , 'dropDown' ] ,
60- [ 'clear' , 'dropDown' , { name : 'custom' , location : 'after' , options : { icon : 'home' } } ] ,
61- [ { name : 'custom' , location : 'before' , options : { icon : 'home' } } , 'clear' , 'dropDown' ] ,
62- [ 'clear' , { name : 'custom' , location : 'before' , options : { icon : 'home' } } , 'dropDown' ] ,
63- [ 'clear' , 'dropDown' , { name : 'custom' , location : 'before' , options : { icon : 'home' } } ] ,
64- ] ) {
65- for ( const rtlEnabled of [ true , false ] ) {
66- const id = `${ `dx${ new Guid ( ) } ` } ` ;
67-
68- await appendElementTo ( '#container' , 'div' , id , { } ) ;
69-
70- await createWidget ( 'dxDateBox' , {
71- value : new Date ( 2021 , 9 , 17 ) ,
72- stylingMode,
73- rtlEnabled,
74- buttons,
75- showClearButton : true ,
76- isValid,
77- } , `#${ id } ` ) ;
78- }
48+ test ( 'DateBox with buttons container' , async ( t ) => {
49+ const { takeScreenshot, compareResults } = createScreenshotsComparer ( t ) ;
50+
51+ await insertStylesheetRulesToPage ( `#container { display: flex; flex-wrap: wrap; } .${ DATEBOX_CLASS } { width: 220px; margin: 2px; }` ) ;
52+
53+ await testScreenshot ( t , takeScreenshot , 'DateBox render with buttons container.png' , { shouldTestInCompact : true } ) ;
54+
55+ await removeStylesheetRulesFromPage ( ) ;
56+
57+ await t
58+ . expect ( compareResults . isValid ( ) )
59+ . ok ( compareResults . errorMessages ( ) ) ;
60+ } ) . before ( async ( ) => {
61+ for ( const stylingMode of stylingModes ) {
62+ for ( const buttons of [
63+ [ 'clear' ] ,
64+ [ 'clear' , 'dropDown' ] ,
65+ [ { name : 'custom' , location : 'after' , options : { icon : 'home' } } , 'clear' , 'dropDown' ] ,
66+ ] ) {
67+ for ( const isValid of [ true , false ] ) {
68+ const id = `${ `dx${ new Guid ( ) } ` } ` ;
69+
70+ await appendElementTo ( '#container' , 'div' , id , { } ) ;
71+
72+ await createWidget ( 'dxDateBox' , {
73+ value : new Date ( 2021 , 9 , 17 ) ,
74+ stylingMode,
75+ buttons,
76+ showClearButton : true ,
77+ isValid,
78+ } , `#${ id } ` ) ;
7979 }
8080 }
81- } ) ;
81+ }
8282} ) ;
0 commit comments