Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(test) O3-3926-Add test coverage for the InlineDateAdapter #422

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

suubi-joshua
Copy link

@suubi-joshua suubi-joshua commented Nov 7, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

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

@suubi-joshua
Copy link
Author

suubi-joshua commented Nov 7, 2024

@samuelmale @pirupius is this the right approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant