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

Fix unsent bills displaying in licence bills tab #1015

Merged
merged 8 commits into from
May 14, 2024

Conversation

Cruikshanks
Copy link
Member

@Cruikshanks Cruikshanks commented May 14, 2024

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

In Add View Licence Bills page we added support for displaying the bills linked to a licence in the view licence page's 'Bills' tab.

Only we didn't spot that it should only be 'sent' bills.

This change updates the relevant fetch service to ensure the bills we get back are only those with a status of 'sent'.

@Cruikshanks Cruikshanks added the bug Something isn't working label May 14, 2024
@Cruikshanks Cruikshanks self-assigned this May 14, 2024
https://eaflood.atlassian.net/browse/WATER-4316

In [Add View Licence Bills page](#986) we added support for displaying the bills linked to a licence in the view licence page's 'Bills' tab.

Only we didn't spot that it should only be 'sent' bills.

This change updates the relevant fetch service to ensure the bills we get back are only those with a status of 'sent'.
@Cruikshanks Cruikshanks force-pushed the fix-bills-in-bills-tab branch from 4099b3b to 9dcf668 Compare May 14, 2024 11:44
The service has a withGraphFetched that we are assuming is finding the matching bill run as we know the presenter this data gets passed to is expecting it.

However, coming in to add a test case for our currently failing scenario we spotted that the existing test is not actually checking for the bill run. Nor was the bill run created actually linked to the bill.

So, we remove everything to do with the bill run from this test to highlight the point we'll need to do some refactoring to ensure the existing scenarios are covered before we make our changes.
Now we have something we can add our scenario around 'sent' bill runs to.
We have a test that describes what happens when a licence has bills. If only for documentation purposes, when we make a statement of behaviour like that it can be handy to show what happens when that is not the case.

```
Fetch Licence Bills service
  when the licence has bills
    and they are linked to a 'sent' bill run
      ✔ 1871) returns results (14 ms)
    but they are not linked to a 'sent' bill run
      ✔ 1872) returns no results (3 ms)
  when the licence has no bills
    ✔ 1873) returns no results (4 ms)
````
@Cruikshanks Cruikshanks marked this pull request as ready for review May 14, 2024 12:25
@Cruikshanks Cruikshanks merged commit 01a63e7 into main May 14, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the fix-bills-in-bills-tab branch May 14, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants