Minor test-coverage gaps noted in the Fields Management final review (non-blocking):
Backend 403 path.crates/api/tests/admin_fields.rs covers 401 (unauthenticated) but not authenticated-with-insufficient-capability → 403. The Authorized<EditCatalogue> extractor is exercised by other test files, so risk is low, but a dedicated case (e.g. a viewer/read-only role POSTing → 403) would close the gap. (Confirm a non-EditCatalogue role exists to seed.)
Frontend authority-kind reveal.web/src/fields/fields.test.tsx covers the Term branch (selecting type=term reveals the vocabulary picker and blocks submit until one is chosen) but not the Authority branch (field-form.tsxdataType === "authority" → the kind <select> with Any/Person/Organisation/Place). A test that selects type=authority, picks a kind, and asserts the posted authority_kind would cover it. (The backend create_authority_field test already covers the API side.)
Both are low-priority polish — the happy paths and the more complex Term branch are covered.
Minor test-coverage gaps noted in the Fields Management final review (non-blocking):
1. **Backend 403 path.** `crates/api/tests/admin_fields.rs` covers `401` (unauthenticated) but not authenticated-with-insufficient-capability → `403`. The `Authorized<EditCatalogue>` extractor is exercised by other test files, so risk is low, but a dedicated case (e.g. a viewer/read-only role POSTing → 403) would close the gap. (Confirm a non-`EditCatalogue` role exists to seed.)
2. **Frontend authority-kind reveal.** `web/src/fields/fields.test.tsx` covers the **Term** branch (selecting type=term reveals the vocabulary picker and blocks submit until one is chosen) but not the **Authority** branch (`field-form.tsx` `dataType === "authority"` → the kind `<select>` with Any/Person/Organisation/Place). A test that selects type=authority, picks a kind, and asserts the posted `authority_kind` would cover it. (The backend `create_authority_field` test already covers the API side.)
Both are low-priority polish — the happy paths and the more complex Term branch are covered.
Frontend authority-kind reveal test — added to web/src/fields/fields.test.tsx (selects the Authority type, picks a kind, asserts the posted authority_kind). Done.
Backend 403 test — not feasible today and intentionally skipped. Only two roles exist (Admin, Editor) and both grant EditCatalogue, so no authenticated user can receive a 403 on field-definition create — there is nothing to assert. When a read-only/viewer role is introduced, the 403 coverage should be added then (it'll come naturally with that role's tests).
Closing as done for the actionable scope; the 403 case will be picked up with a future viewer role.
Resolved in `0d971cd`:
- **Frontend authority-kind reveal test** — added to `web/src/fields/fields.test.tsx` (selects the Authority type, picks a kind, asserts the posted `authority_kind`). Done.
- **Backend 403 test** — **not feasible today and intentionally skipped.** Only two roles exist (`Admin`, `Editor`) and *both* grant `EditCatalogue`, so no authenticated user can receive a 403 on field-definition create — there is nothing to assert. When a read-only/viewer role is introduced, the 403 coverage should be added then (it'll come naturally with that role's tests).
Closing as done for the actionable scope; the 403 case will be picked up with a future viewer role.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Minor test-coverage gaps noted in the Fields Management final review (non-blocking):
Backend 403 path.
crates/api/tests/admin_fields.rscovers401(unauthenticated) but not authenticated-with-insufficient-capability →403. TheAuthorized<EditCatalogue>extractor is exercised by other test files, so risk is low, but a dedicated case (e.g. a viewer/read-only role POSTing → 403) would close the gap. (Confirm a non-EditCataloguerole exists to seed.)Frontend authority-kind reveal.
web/src/fields/fields.test.tsxcovers the Term branch (selecting type=term reveals the vocabulary picker and blocks submit until one is chosen) but not the Authority branch (field-form.tsxdataType === "authority"→ the kind<select>with Any/Person/Organisation/Place). A test that selects type=authority, picks a kind, and asserts the postedauthority_kindwould cover it. (The backendcreate_authority_fieldtest already covers the API side.)Both are low-priority polish — the happy paths and the more complex Term branch are covered.
Resolved in
0d971cd:web/src/fields/fields.test.tsx(selects the Authority type, picks a kind, asserts the postedauthority_kind). Done.Admin,Editor) and both grantEditCatalogue, so no authenticated user can receive a 403 on field-definition create — there is nothing to assert. When a read-only/viewer role is introduced, the 403 coverage should be added then (it'll come naturally with that role's tests).Closing as done for the actionable scope; the 403 case will be picked up with a future viewer role.