(test) O3-3926 Add test coverage for the InlineDateAdapter #422
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements
Summary
This PR introduces test coverage for the InlineDateAdapter to ensure robust handling of date transformations within form fields. Key scenarios tested include:
Updating Observation Dates: Tests confirm that when a new date is provided, the adapter correctly updates the obsDatetime field in the target field’s submission, ensuring accuracy in new entries.
Editing Dates in Edit Mode: Verifies that the adapter updates dates accurately when modified in edit mode, supporting seamless updates to existing records.
Conditional Side-Effects: Tests check that side-effects only trigger when there’s an actual change in the date value, avoiding redundant updates.
Commitment on Value Presence: Ensures side-effects are committed if the target field holds a value or has an existing submission, facilitating reliable updates when data is available.
Initial Value Extraction: Confirms that the adapter retrieves initial observation dates correctly from the previous value, essential for accurate pre-filling.
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-3926
Other