openfoodnetwork
openfoodnetwork copied to clipboard
Alert user when error requesting a report
I'm not sure why, but Turbo was swallowing the unauthorized
error, so I thought we should alert the user to help with debugging. Same with network error, it gave no feedback before.
I think this can be tested with Capybara in theory, but I haven't invested the time on it.
What should we test?
This occurs whenever submitting a form with Turbo. The best example is running any report.
There are three types of errors, I can think of a way to test two of them:
- Network error: turn off wifi/disable network
- Authorisation error: This can be tested with bug #12835. Otherwise I think you could test this by log out in another tab then log in as a shopper
- Other errors (eg 500)