You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The validateRequired test fails when validating a required dateTime field that is present in the data with a valid Date object.
Version/Branch
master
To Reproduce
Steps to reproduce the behavior:
Add the following test to the code:
it('Validating a dateTime that is required and present in the data with a valid date object will return null',asyncfunction(){constcomponent={ ...simpleDateTimeField,validate: {required: true}};constdata={component: newDate()};constcontext=generateProcessorContext(component,data);constresult=awaitvalidateRequired(context);expect(result).to.equal(null);});
Run the test.
Observe that it fails.
Expected behavior
The test should return null when validating a valid Date object for a required dateTime field.
Additional context
After reviewing the code, the issue is resolved by modifying the valueIsPresent function to correctly handle Date values. The proposed modification is as follows:
Describe the bug
The
validateRequired
test fails when validating a requireddateTime
field that is present in the data with a validDate
object.Version/Branch
master
To Reproduce
Steps to reproduce the behavior:
Add the following test to the code:
Run the test.
Observe that it fails.
Expected behavior
The test should return
null
when validating a validDate
object for a requireddateTime
field.Additional context
After reviewing the code, the issue is resolved by modifying the
valueIsPresent
function to correctly handleDate
values. The proposed modification is as follows:The modification was made in the file validateRequired.ts.
With this modification, the test passes correctly.
The text was updated successfully, but these errors were encountered: