openfoodnetwork icon indicating copy to clipboard operation
openfoodnetwork copied to clipboard

Alert user when error requesting a report

Open dacook opened this issue 5 months ago • 2 comments

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:

  1. Network error: turn off wifi/disable network
  2. 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
  3. Other errors (eg 500)

dacook avatar Sep 17 '24 03:09 dacook