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

What do you want to do with this return? #1570

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Dec 16, 2024

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

Build a page to enable the user to choose what they want to do with the return.

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

Build a page to enable the user to choose how they would like to edit a return.
@Jozzey Jozzey added the enhancement New feature or request label Dec 16, 2024
@Jozzey Jozzey self-assigned this Dec 16, 2024
@Jozzey Jozzey changed the title How would you like to edit this return What do you want to do with this return? Jan 10, 2025
@Jozzey Jozzey marked this pull request as ready for review January 10, 2025 18:52
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.

The main reason I've asked for changes is it is not quite following the pattern we've used in other pages or presenter tests.

I get that it might seem pointless. Why, for example, go to the effort of adding a validator and associated unit test for something so 'simple'?

The reason is the pattern/convention is intended to save us the effort involved in deciding where the line for 'simple' is. Or coming back to something 12 months later and trying to understand why 'x' does it this way, but 'y' doesn't.

For most pages in this journey, there are existing matching or similar pages we can copy and use. They're there, so each time we have to add a journey (IMHO the bulk of a typical digital service), they get easier and quicker because our library of existing pages keeps growing.

Hope this makes sense, and happy to discuss further if needed.

Comment on lines +47 to +49
app: {
plainOutput: true
},
Copy link
Member

Choose a reason for hiding this comment

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

This is not an API only endpoint so should not have this config.

Suggested change
app: {
plainOutput: true
},

Comment on lines +62 to +64
app: {
plainOutput: true
},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
app: {
plainOutput: true
},

Comment on lines +47 to +53
function _validate(whatToDo) {
if (!whatToDo) {
return { text: 'Select what you want to do with this return' }
}

return null
}
Copy link
Member

Choose a reason for hiding this comment

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

I appreciate this is all that is needed to validate the entry. But it breaks the pattern we have used for all our other pages.

We need a proper Joi-based validator for this, of which there are plenty you can crib from.

})
})

describe('when the status is not yet "overdue"', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I know 'overdue' is covered by the test above. However, our unit tests can also serve as a form of documentation. So, usually, in the presenter tests, if a property is based on some logic, we try to cover all expected behaviours in the tests, even if the main "correctly presents the data" already covers it.

So, I would add a final scenario to this group to document that the status will be' overdue' when the due date is less than `today()'.

This applies to all the properties. Just noticed they are only testing behaviour not covered by "correctly presents the data".

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

Successfully merging this pull request may close these issues.

2 participants