feat(ext): org error-copy entries for ERROR_COPY coverage gate
The full-suite meta-test (src/shared/__tests__/error-copy.test.ts) requires a user-facing ERROR_COPY entry for every literal 'ok: false, error: <code>' the SW returns. The org handlers added org_not_configured (literal) with no copy → RED. Add org_not_configured plus copy for the org codes that reach the popup via thrown err.message (not_an_org_member, device_key_unavailable, not_in_org_context, org_switch_failed). item_not_found already had an entry. (Dev-B added some of these independently; B reconciles the wording when it syncs main post-merge.) Full extension vitest: 70 files / 478 tests green (incl. error-copy 3/3). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014s527M917W47LDrfQ4t47g
This commit is contained in:
@@ -113,6 +113,28 @@ export const ERROR_COPY: Record<string, ErrorCopy> = {
|
|||||||
title: 'Unsupported vault type',
|
title: 'Unsupported vault type',
|
||||||
body: 'This vault uses a second-factor type not supported by this version of Relicario — update the extension.',
|
body: 'This vault uses a second-factor type not supported by this version of Relicario — update the extension.',
|
||||||
},
|
},
|
||||||
|
// --- Org vault (Plan A) ---
|
||||||
|
org_not_configured: {
|
||||||
|
title: 'Organization not set up',
|
||||||
|
body: 'This organization is not configured in this extension yet — add it before switching to it.',
|
||||||
|
},
|
||||||
|
not_an_org_member: {
|
||||||
|
title: 'Not a member',
|
||||||
|
body: 'This device is not a member of that organization. Ask an org admin to add this device key.',
|
||||||
|
},
|
||||||
|
device_key_unavailable: {
|
||||||
|
title: 'Device key unavailable',
|
||||||
|
body: 'Unlock your personal vault first so this device can open organization vaults.',
|
||||||
|
cta: UNLOCK_CTA,
|
||||||
|
},
|
||||||
|
not_in_org_context: {
|
||||||
|
title: 'No organization selected',
|
||||||
|
body: 'Switch to an organization before viewing its items.',
|
||||||
|
},
|
||||||
|
org_switch_failed: {
|
||||||
|
title: 'Could not open organization',
|
||||||
|
body: 'Something went wrong opening that organization — check your connection and try again.',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function lookupErrorCopy(code: string): ErrorCopy {
|
export function lookupErrorCopy(code: string): ErrorCopy {
|
||||||
|
|||||||
Reference in New Issue
Block a user