Skip to content

Added test for gillick consent and self consent on the same day and next#1141

Open
chinmaymudholkar1 wants to merge 2 commits intomainfrom
gillick-vaccs-day-b
Open

Added test for gillick consent and self consent on the same day and next#1141
chinmaymudholkar1 wants to merge 2 commits intomainfrom
gillick-vaccs-day-b

Conversation

@chinmaymudholkar1
Copy link
Copy Markdown
Collaborator

Added tests for https://nhsd-jira.digital.nhs.uk/browse/MAV-5915 to check that:

  • A child can be vaccinated on the same day as gillick consent
  • Child cannot be vaccinated on the next day

@chinmaymudholkar1 chinmaymudholkar1 requested a review from a team as a code owner April 22, 2026 16:20
indirect=True,
ids=lambda v: f"{v[0]}-{v[1]}",
)
def test_gillick_consent_and_vaccination(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth extending the existing `test_gillick with the self-consent and vaccination steps rather than creating a new one?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the two should be separate because of the different validation points - test_gillick tests CRUD operations on Gillick assessments while test_gillick_consent_and_vaccination tests the vaccination workflow.
If test_gillick fails, it's a Gillick assessment issue; if test_gillick_consent_and_vaccination fails, it's a workflow integration issue

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it touches on different parts, but depending on where the test fails tells us which section, which is why I think it's okay for them to be the same test.

For example, if something has broken in the Gillick assessment part then both test_gillick and test_gillick_consent_and_vaccination will break, therefore test_gillick is not giving us any additional information.

Comment on lines +371 to +372
Test: Verify that Gillick consent given on day A cannot be used
to vaccinate on day B.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this tests the right thing, this ends up testing that the session allows you to record vaccinations, and it doesn't because it's on a different day (the text on the "Record vaccinations" tab shows the message as such). However, this will be the case regardless of whether the child has self-consent or not, so it's not testing the specifics of self-consent.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am only trying to assert that a child cannot be vaccinated the next/different day if they have self consented. I am not sure if this particular scenario can be tested in any other way. Open to suggestions if there is.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this scenario can be tested with the end-to-end tests at the moment, it requires the current date to be changed to a different day which is recorded as a coverage gap: #852

…me day as gillick consent and vaccination cannot be recorded next day.
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.

2 participants