You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(e2e): use getByRole('checkbox') for reka-ui Checkbox + cookie scope fix (#145)
* fix(api-keys): filter stale provider IDs instead of rejecting
When an API key has allowedProviders referencing a provider that no
longer exists in the registry (stale ID), the update operation would
fail with 'unknown provider(s)' error.
Now validate_providers() has been replaced with filter_valid_providers()
which silently removes unknown IDs instead of rejecting the entire
operation. This allows users to edit API keys even when some provider
references have become stale.
Changes:
- manage_api_keys.rs: filter_valid_providers() filters stale IDs
- api_key_provider_validation.rs: updated 3 unit tests for new behavior
- api-keys.spec.ts: added 5 new E2E tests for provider restrictions
* feat(dashboard): group API key providers by kind with collapsible accordion
When an API key has many providers configured (e.g., 500+), a flat
checkbox list doesn't scale. This change groups providers by their
providerKind and displays them in a collapsible accordion:
- Each group shows: kind name, provider count, selected count
- Groups are collapsed by default to reduce visual noise
- Group-level checkbox allows select-all/deselect-all for a kind
- Individual providers can still be toggled independently
Before: flat list of 500+ checkboxes (unmanageable)
After: accordion grouped by kind (e.g., Ollama Cloud: 500 providers)
* fix(e2e): use getByRole('checkbox') for reka-ui Checkbox in clears-provider test
The reka-ui Checkbox uses a visually-hidden <input> with role="checkbox"
on the visible button. The previous selector [data-testid^="provider-checkbox-"]
targeted the wrapper, and setChecked() on it didn't trigger the
@update:model-value event that updates the form state.
Clicking the role=checkbox element (the visible button) correctly dispatches
the events the reka-ui Checkbox listens for. Only uncheck if currently
checked (data-state='checked') to avoid toggling wrong state.
Also fixes a double-slash URL bug: ${DASHBOARD_URL}/api-keys became
/dashboard//api-keys because DASHBOARD_URL already ends with /. Use
${DASHBOARD_URL}api-keys (no leading slash) for navigation.
Cookie scope fix in global-setup: use explicit domain: 'localhost',
path: '/' instead of url: DASHBOARD_URL — the latter would infer path
/dashboard, blocking cookies from being sent to /api/* Vite-proxied routes.
API_BASE_URL defaults to http://127.0.0.1:8081 (Docker proxy on macOS
only forwards IPv4, localhost resolves to ::1 first causing ECONNRESET).
DASHBOARD_URL keeps localhost since Vite dev server runs on localhost:4747.
All 47 e2e tests pass (7 webkit skipped due to known CSRF Docker image issue).
just ci-local: ALL PASSED (369s total)
* fix(ApiKeyForm): add accordion mock and ChevronDown to @lucide/vue mock
The Vue component uses the Accordion UI primitives and ChevronDown icon.
Vitest was failing because these weren't mocked in the spec file.
Co-authored-by: copilot
* fix(dashboard): set Vite dev server port to 4747
The E2E tests expect the dashboard on localhost:4747. Without this
setting, Vite defaults to 5173 and global-setup.ts fails with
ERR_CONNECTION_REFUSED.
* fix(e2e): handle HTML responses in getProvidersViaApi
Avoid SyntaxError when API returns HTML instead of JSON (e.g. 404
pages, redirects). Also handle both { providers: [...] } wrapper
and direct array response formats.
Fixes 9 failing E2E tests in PR #145
* fix: address review comments from PR #145
* fix(e2e): capture key and use deterministic provider selector in adds-new-provider test
- Assign result of createApiKeyWithProvidersViaApi to const key (fixes undefined key.id)
- Use provider-checkbox-${secondProvider.id} data-testid instead of nth(1) index
to drive selection, then use same provider id for the assertion
* fix(e2e): skip provider-restriction tests gracefully when registry is empty
Replace hard expect() failures with test.skip() guards so the 3
provider-restriction tests skip cleanly in Docker environments that
don't have providers seeded, instead of hard-failing.
Also fix indentation in 'clears provider restrictions via UI' test
where 6-space indent incorrectly nested the test body inside a
stale 'if' block from a prior edit.
---------
Co-authored-by: kerrigan <kerrigan@local>
0 commit comments