mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-14 17:42:17 +00:00
de39dc78ea
Splits testing into five layers so a failure points at the responsible one: - tests/unit isolated utility, repository and service tests - tests/data validates the tracked Pokémon, game, region and dex files - tests/integration schema, views, constraints, RLS and repositories - tests/bdd executable Gherkin for user-visible behaviour - tests/build service worker and manifest artifacts per build variant Replaces the two Playwright specs in client-test/ and the two Vitest files in test/. Adds a GitHub Actions workflow running the layers as separate jobs, a mock OAuth provider server so the Drive and Dropbox scenarios never touch real accounts, and a wrapper that reads the local Supabase keys from `supabase status` rather than hard-coding them. Extracts the pure formatting helpers out of PokedexExportService so they can be unit tested, and makes the provider endpoints configurable so the mock server can stand in for Google and Dropbox.
44 lines
1.4 KiB
Gherkin
44 lines
1.4 KiB
Gherkin
Feature: Backup and export
|
|
As a trainer
|
|
I want changes exported to my connected storage
|
|
So that I retain a portable backup
|
|
|
|
Background:
|
|
Given I am signed in
|
|
|
|
Scenario: Show disconnected backup providers
|
|
When I visit backup settings
|
|
Then Google Drive and Dropbox are shown as not connected
|
|
|
|
Scenario Outline: Connect a backup provider
|
|
When I connect the mocked "<provider>" provider
|
|
Then "<provider>" is shown as connected
|
|
|
|
Examples:
|
|
| provider |
|
|
| Google Drive |
|
|
| Dropbox |
|
|
|
|
Scenario: Reject an invalid OAuth state
|
|
When a mocked OAuth callback has an invalid state
|
|
Then the backup connection is rejected
|
|
|
|
Scenario: Export escaped catch data without losing the update
|
|
Given Google Drive is connected to the mocked provider
|
|
And I have a Living Dex named "Quoted, Dex"
|
|
When I save a catch note containing a comma and quote
|
|
Then the mocked provider receives a valid escaped CSV
|
|
And the catch update remains saved
|
|
|
|
Scenario: Refresh an expired provider token
|
|
Given Dropbox is connected with an expired token
|
|
When an export is requested
|
|
Then the token is refreshed before the mocked upload
|
|
|
|
Scenario: Record provider failure without losing progress
|
|
Given Google Drive is connected to a failing mocked provider
|
|
When I update collection progress
|
|
Then the catch update remains saved
|
|
And the provider failure is shown in backup settings
|
|
|