fix(e2e): repair filestorage + permissions tests#212
Merged
Conversation
…ehavior - FileStorage upload/delete unauthenticated: API endpoints return 401 (not 302) since the SmartAuth policy scheme does not redirect API clients; update the two permission tests to expect 401. - Settings page test: /settings is a 404; correct route is /settings/me (User Settings view); update the navigation target. - Admin unauthenticated test: /api/admin/users does not exist (404 fallthrough); the real route that triggers an Identity cookie redirect is GET /admin/users; fix the request path. - playwright.config.ts: honour PLAYWRIGHT_BASE_URL env var so parallel CI agents can each run their host on a different port.
Deploying simplemodule-website with
|
| Latest commit: |
933dd04
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bbc021f2.simplemodule-website.pages.dev |
| Branch Preview URL: | https://fix-storage-and-permissions.simplemodule-website.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 4 pre-existing failing e2e tests across 2 spec files.
FileStorage permissions (2 tests):
POST /api/filesandDELETE /api/files/{id}unauthenticated were expected to return302but actually return401. The SmartAuth policy scheme forwards challenge to the Identity cookie scheme for browser navigation, but APIAPIRequestContextcalls (noAccept: text/html, no cookies) get401— which is the correct and intended behavior for machine clients. Updated assertions fromtoBe(302)→toBe(401).Settings page test: Test navigated to
/settingswhich is a 404 (no route matches that bare path). The correct user-facing settings route is/settings/me(rendersUserSettingscomponent with heading "My Settings", which matches/settings/i). Fixed navigation target.Admin unauthenticated test: Test hit
GET /api/admin/userswhich does not exist — falls through to the anonymous catch-all returning404. The real route that triggers Identity cookie redirect isGET /admin/users(the Inertia view endpoint). Fixed request URL.playwright.config.ts: Added
PLAYWRIGHT_BASE_URLenv var support so parallel CI agents can each run their host on a dedicated port without patching the config file.Test plan
filestorage-crud.spec.tsandpermissions.spec.tspass locally.tsfiles