mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 15:02:04 +00:00
fix(settings): keep the health-record entry reachable regardless of the doctorReport opt-out
The health-record section (PDF + FHIR R4 export) was the only entry-point gated on the doctorReport module's nav toggle, so flipping that opt-out in the Modules hub made the whole section vanish from Settings with no in-context way back. Drop the nav gate: the entry-point now always shows. The doctorReport module still governs the data layer — the server-side /api/export/health-record route stays the hard enforcement (403 module.disabled over Bearer when opted out). Assert the entry shows for a default, empty, and opted-out modules map.
This commit is contained in:
1 parent
6f866ff1c6
commit
dae7138fc6
3 files changed
+28
-14
No files matched your search
@@ -239,17 +239,23 @@ describe("<SettingsShell>", () => {
|
||||
expect(disabled).not.toContain('href="/settings/coach"');
|
||||
});
|
||||
|
||||
it("module-gates the Health-record entry off `user.modules.doctorReport` (B3)", () => {
|
||||
// Fail-open default: doctorReport undefined → entry shown.
|
||||
it("always surfaces the Health-record entry, regardless of `doctorReport` (v1.18.6.1)", () => {
|
||||
// The health-record (PDF / FHIR) entry is a flagship export capability
|
||||
// and is no longer nav-gated: a default/unset modules map shows it, and
|
||||
// even an explicit `doctorReport: false` keeps the Settings entry-point
|
||||
// reachable. The server-side `/api/export/health-record` route remains
|
||||
// the hard enforcement of the opt-out.
|
||||
expect(renderShell({ active: "account" })).toContain(
|
||||
'href="/settings/gesundheitsakte"',
|
||||
);
|
||||
// Explicitly disabled → entry hidden.
|
||||
const disabled = renderShell({
|
||||
expect(renderShell({ active: "account", modules: {} })).toContain(
|
||||
'href="/settings/gesundheitsakte"',
|
||||
);
|
||||
const optedOut = renderShell({
|
||||
active: "account",
|
||||
modules: { doctorReport: false },
|
||||
});
|
||||
expect(disabled).not.toContain('href="/settings/gesundheitsakte"');
|
||||
expect(optedOut).toContain('href="/settings/gesundheitsakte"');
|
||||
});
|
||||
|
||||
it("falls back to `account` when the pathname doesn't match a known slug", () => {
|
||||
|
||||
Reference in new issue
Block a user