Files
LivingDexTracker/tests/bdd/features/pwa-offline.feature
T
Josh Creek fb95b43b30 fix(backup): pause revoked backups and tell users to reconnect
Google answers a revoked or expired refresh token with invalid_grant.
Every save then retried the dead token, and reconnecting never cleared
the old error, so it kept showing on Backup Settings afterwards.

- The Google Drive and Dropbox OAuth callbacks clear lastError when a
  provider is reconnected.
- An invalid_grant, or a missing refresh token, now pauses the
  integration with a readable "reconnect" message instead of retrying
  it on every catch update. Other failures still retry as before.
- A banner on every page and an alert on the Pokédex page point to
  Backup Settings, which shows a "Reconnect needed" badge. The Pokédex
  page re-checks backup status after each export, because saving a
  catch record also exports on the server and may pause a provider
  first.
- Offline sync status and the "Save all artwork" link move from every
  page to a new /offline-guide page, linked from the user menu and the
  home and welcome pages. Only the offline read-only banner stays
  sitewide.
- Unit tests cover every export path and the backup status store. BDD
  covers revocation and reconnecting for both providers, and the
  offline guide. The mock provider can now reject token refreshes, and
  mock control calls fail loudly if a stale mock is reused. Coverage
  thresholds are raised to the new baseline.
2026-09-14 18:46:09 +01:00

47 lines
1.7 KiB
Gherkin

Feature: Offline-friendly application
As a trainer
I want the installed site to survive network loss
So that I can consult my collection anywhere
Scenario: Register the service worker
When I open the built application
Then a service worker controls the page
And the application shell is precached
And no legacy service worker is requested
Scenario: Reload the home page while offline
Given I have opened the built application online
When I go offline and reload the home page
Then the read-only offline viewer is available
Scenario: Reload a nested route while offline
Given I have opened the built application online
When I go offline and reload the sign-in page
Then the read-only offline viewer is available
Scenario: Read a synchronized collection offline
Given I am signed in
And I have a Living Dex named "Offline Collection"
And my offline copy is synchronized
When I go offline and reload the current Pokédex
Then the offline copy contains "Offline Collection"
Scenario: Explain offline use on the offline guide
Given I am signed in
When I open the offline guide
Then the offline guide shows my offline copy status
Scenario: Keep offline sync status off everyday pages
Given I am signed in
And I have a Living Dex named "Quiet Offline"
And my offline copy is synchronized
When I open the offline guide from the user menu
Then the offline guide shows when my offline copy was updated
When I return to my Pokédexes from the user menu
Then no offline sync status is shown
Scenario: Restore network access
Given I have opened the built application online
When I go offline and then return online
Then the application remains available