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

Update return logs helper #1226

Merged
merged 2 commits into from
Aug 1, 2024
Merged

Update return logs helper #1226

merged 2 commits into from
Aug 1, 2024

Conversation

Beckyrose200
Copy link
Contributor

@Beckyrose200 Beckyrose200 commented Aug 1, 2024

https://eaflood.atlassian.net/browse/WATER-4523

While migrating the fixture files for the acceptance tests, it was noticed that the return-log helper defaults the return-log as being status 'completed' and therefore it has a 'receivedDate'.

Our acceptance tests use these helpers to load the data from our fixture file.

We have instances of tests breaking because of the return-log helper. The tests set up the data in a fixtures file that is sent to the load.service endpoint as a request payload. Hapi when passing a payload will strip out any null values. For these failing tests the 'recievedDate' needs to be null. When hapi removes the null values, the data passed to the helper will have no 'recievedDate' property, meaning the helper will then use the default data, which populated the date.

This change is to default the return-log helper as a due return rather than a completed return, removing the default data in 'recievedDate' and changing the status to 'due' so the data is more real.
This solves our acceptance test issue, without breaking any unit tests either.

Whilst migrating the fixture files for the acceptance tests, it was noticed that a few of our model helpers were not set up to take test data correctly. This PR is fixing that.
@Beckyrose200 Beckyrose200 self-assigned this Aug 1, 2024
@Beckyrose200 Beckyrose200 added the housekeeping Refactoring, tidying up or other work which supports the project label Aug 1, 2024
@Beckyrose200 Beckyrose200 marked this pull request as ready for review August 1, 2024 16:10
Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

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

This is an example of where the helper shouldn't have been setting a default value as we talked about the other day.

@Beckyrose200 Beckyrose200 merged commit 7f12a88 into main Aug 1, 2024
6 checks passed
@Beckyrose200 Beckyrose200 deleted the acceptance-test-housekeeping branch August 1, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants