@@ -22,12 +22,23 @@ describe('Node/-RED Dashboard 2.0 - Text Input Widget', () => {
2222 cy . get ( '#nrdb-ui-widget-c1d2e3f4a5b60718 .v-field__field label' ) . should ( 'contain' , 'Marking Notes' )
2323 } )
2424
25- // Regression test for #2008: textarea must keep its top padding so the
26- // floating label doesn't overlap the text (not collapsed to the global 2px).
27- it ( 'keeps top padding in textarea mode so the label does not overlap the text' , ( ) => {
28- cy . get ( '#nrdb-ui-widget-c1d2e3f4a5b60718 textarea' )
29- . parents ( '.v-field' ) . first ( )
30- . find ( '.v-field__input' )
31- . should ( 'have.css' , 'padding-top' , '12px' )
25+ // Textarea padding is derived from the row height so the label clears the text
26+ // without growing the row, scaling across densities (32/38/48px).
27+ const densities = [
28+ { name : 'compact (32px row)' , cls : 'nrdb-view-density--compact' , top : '4px' , bottom : '0px' } ,
29+ { name : 'comfortable (38px row)' , cls : 'nrdb-view-density--comfortable' , top : '7px' , bottom : '3px' } ,
30+ { name : 'default (48px row)' , cls : 'nrdb-view-density--default' , top : '12px' , bottom : '8px' }
31+ ]
32+ densities . forEach ( ( { name, cls, top, bottom } ) => {
33+ it ( `derives textarea padding from the row height at ${ name } ` , ( ) => {
34+ cy . get ( '.nrdb-app' )
35+ . invoke ( 'removeClass' , 'nrdb-view-density--compact nrdb-view-density--comfortable nrdb-view-density--default' )
36+ . invoke ( 'addClass' , cls )
37+ cy . get ( '#nrdb-ui-widget-c1d2e3f4a5b60718 textarea' )
38+ . parents ( '.v-field' ) . first ( )
39+ . find ( '.v-field__input' )
40+ . should ( 'have.css' , 'padding-top' , top )
41+ . and ( 'have.css' , 'padding-bottom' , bottom )
42+ } )
3243 } )
3344} )
0 commit comments