File tree Expand file tree Collapse file tree
client/src/pages/platform/workflow-editor/components/properties
components/property-input Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,17 +133,17 @@ describe('PropertyInput', async () => {
133133 } ) ;
134134
135135 it ( 'uses minute precision (step=60) for time inputs so the field is easily clearable' , ( ) => {
136- const { container } = render ( < PropertyInput aria-label = "Time" label = "Time" name = "time" type = "time" /> ) ;
136+ render ( < PropertyInput aria-label = "Time" label = "Time" name = "time" type = "time" /> ) ;
137137
138- const input = container . querySelector ( 'input[type=" time"]' ) ;
138+ const input = screen . getByLabelText ( / t i m e / i ) ;
139139
140140 expect ( input ) . toHaveAttribute ( 'step' , '60' ) ;
141141 } ) ;
142142
143143 it ( 'keeps step=1 for non-time inputs' , ( ) => {
144- const { container } = render ( < PropertyInput aria-label = "Date" label = "Date" name = "date" type = "date" /> ) ;
144+ render ( < PropertyInput aria-label = "Date" label = "Date" name = "date" type = "date" /> ) ;
145145
146- const input = container . querySelector ( 'input[type=" date"]' ) ;
146+ const input = screen . getByLabelText ( / d a t e / i ) ;
147147
148148 expect ( input ) . toHaveAttribute ( 'step' , '1' ) ;
149149 } ) ;
Original file line number Diff line number Diff line change @@ -569,10 +569,10 @@ export const useProperty = ({
569569
570570 let resolvedValue : unknown ;
571571
572- if ( isNumericalInput ) {
573- resolvedValue = parseFloat ( valueToSave as string ) ;
574- } else if ( valueToSave === '' && isDateOrTimeControlType ) {
572+ if ( valueToSave === '' && ( isNumericalInput || isDateOrTimeControlType ) ) {
575573 resolvedValue = null ;
574+ } else if ( isNumericalInput ) {
575+ resolvedValue = parseFloat ( valueToSave as string ) ;
576576 } else {
577577 resolvedValue = valueToSave ;
578578 }
You can’t perform that action at this time.
0 commit comments