mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 16:12:11 +00:00
feat(settings): standardize settings and admin section framing
Introduce a shared SettingsSectionFrame (the settings twin of the admin renderer's SectionFrame) that emits the canonical visible heading + subheading, and route all 19 settings sections through it. Every settings page now shows a real h1 + subtitle in the reference Übersicht style instead of an invisible sr-only title; the section bodies drop their own headings and off-style intro paragraphs (the explanatory copy folds into the frame subtitle). - Route the admin About page through SectionFrame so it carries the same visible heading as every other admin section. - Rename the AI settings section from KI-Auswertung to KI-Anbieter across six locales: the page configures the provider and key, not an analysis. - Add a heading-block spacer to the settings and admin sidebars so the first menu item lines up with the top of the first card. - Remove the always-on core-domains card from Module: a tracking area that can't be turned off doesn't need listing. - Move the proactive-coach control out of Benachrichtigungen into Coach. - Move admin module availability out of the Coach section into its own page: it gates every module, not just the coach. - Give the Layout Insights editor a proper Insights heading. Adds settings.sections.<slug>.subtitle and the new admin keys across all six locales; removes the now-unused module core-domain strings.
This commit is contained in:
1 parent
ae3091df9e
commit
33d7d103da
42 files changed
+822
-802
No files matched your search
@@ -31,12 +31,17 @@ vi.mock("@/hooks/use-auth", () => ({
|
||||
}));
|
||||
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import { SettingsSectionFrame } from "../settings-section-frame";
|
||||
import { CoachSection } from "../coach-section";
|
||||
|
||||
function render(locale: "en" | "de" = "en") {
|
||||
// v1.18.6 (W9) — the visible heading lives in the shared frame the route
|
||||
// wraps the section in; render through it so the heading id is present.
|
||||
return renderToStaticMarkup(
|
||||
<I18nProvider initialLocale={locale}>
|
||||
<CoachSection />
|
||||
<SettingsSectionFrame slug="coach">
|
||||
<CoachSection />
|
||||
</SettingsSectionFrame>
|
||||
</I18nProvider>,
|
||||
);
|
||||
}
|
||||
@@ -51,6 +56,9 @@ describe("<CoachSection> — SSR smoke", () => {
|
||||
// v1.18.1 (D7) — polarity flipped to activate/default-on.
|
||||
expect(html).toContain("Activate Coach");
|
||||
expect(html).toContain("Show the Coach button and drawer. On by default");
|
||||
// v1.18.6 (W9) — the proactive Coach nudge card moved here from
|
||||
// Benachrichtigungen; its anchor renders under the enabled-coach gate.
|
||||
expect(html).toContain('id="coach-nudge"');
|
||||
// Raw key never leaks past i18n.
|
||||
expect(html).not.toContain("settings.sections.coach.");
|
||||
expect(html).not.toContain("settings.coach.activate.");
|
||||
|
||||
@@ -44,6 +44,7 @@ vi.mock("@/hooks/use-auth", () => ({
|
||||
}));
|
||||
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import { SettingsSectionFrame } from "../settings-section-frame";
|
||||
import { ExportSection } from "../export-section";
|
||||
|
||||
function render(node: React.ReactElement, locale: "en" | "de" = "en") {
|
||||
@@ -54,7 +55,13 @@ function render(node: React.ReactElement, locale: "en" | "de" = "en") {
|
||||
|
||||
describe("<ExportSection> — SSR smoke", () => {
|
||||
it("renders the section heading + description", () => {
|
||||
const html = render(<ExportSection />);
|
||||
// v1.18.6 (W9) — the page heading comes from the shared frame the route
|
||||
// wraps the section in.
|
||||
const html = render(
|
||||
<SettingsSectionFrame slug="export">
|
||||
<ExportSection />
|
||||
</SettingsSectionFrame>,
|
||||
);
|
||||
// v1.15.7 — the section was relabelled "Export & Import" (issue #281).
|
||||
expect(html).toContain("Export & Import");
|
||||
// Raw key never leaks past i18n.
|
||||
|
||||
@@ -29,6 +29,7 @@ vi.mock("@/hooks/use-auth", () => ({
|
||||
}));
|
||||
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import { SettingsSectionFrame } from "../settings-section-frame";
|
||||
import { GesundheitsakteSection } from "../gesundheitsakte-section";
|
||||
|
||||
function render(node: React.ReactElement, locale: "en" | "de" = "en") {
|
||||
@@ -38,8 +39,14 @@ function render(node: React.ReactElement, locale: "en" | "de" = "en") {
|
||||
}
|
||||
|
||||
describe("<GesundheitsakteSection> — SSR smoke", () => {
|
||||
it("renders the section description and the health-record panel", () => {
|
||||
const html = render(<GesundheitsakteSection />);
|
||||
it("renders the section heading and the health-record panel", () => {
|
||||
// v1.18.6 (W9) — the visible heading (with the historic id) comes from
|
||||
// the shared frame the route wraps the section in.
|
||||
const html = render(
|
||||
<SettingsSectionFrame slug="gesundheitsakte">
|
||||
<GesundheitsakteSection />
|
||||
</SettingsSectionFrame>,
|
||||
);
|
||||
expect(html).toContain('id="settings-section-gesundheitsakte-title"');
|
||||
expect(html).toContain('data-testid="health-record-export-panel"');
|
||||
// Raw key never leaks past i18n.
|
||||
|
||||
@@ -65,12 +65,17 @@ vi.mock("@/hooks/use-auth", () => ({
|
||||
}));
|
||||
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import { SettingsSectionFrame } from "../settings-section-frame";
|
||||
import { MedicationsSection } from "../medications-section";
|
||||
|
||||
function render(locale: "en" | "de" = "en"): string {
|
||||
// v1.18.6 (W9) — the visible heading (with the historic id) comes from the
|
||||
// shared frame the route wraps the section in.
|
||||
return renderToStaticMarkup(
|
||||
<I18nProvider initialLocale={locale}>
|
||||
<MedicationsSection />
|
||||
<SettingsSectionFrame slug="medications">
|
||||
<MedicationsSection />
|
||||
</SettingsSectionFrame>
|
||||
</I18nProvider>,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -20,11 +20,7 @@ import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import type { AuthUser } from "@/hooks/use-auth";
|
||||
import { queryKeys } from "@/lib/query-keys";
|
||||
import {
|
||||
MODULE_KEYS,
|
||||
CORE_DOMAIN_KEYS,
|
||||
moduleDelegatesTo,
|
||||
} from "@/lib/modules/registry";
|
||||
import { MODULE_KEYS, moduleDelegatesTo } from "@/lib/modules/registry";
|
||||
|
||||
// Capture the latest useMutation config + a shared mutate spy so we can
|
||||
// invoke `mutationFn` / `onSuccess` by hand (the SSR pass can't fire a
|
||||
@@ -46,9 +42,9 @@ vi.mock("@tanstack/react-query", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
const authSpy = vi.fn<() => { user: AuthUser | null; isAuthenticated: boolean }>(
|
||||
() => ({ user: buildUser({}), isAuthenticated: true }),
|
||||
);
|
||||
const authSpy = vi.fn<
|
||||
() => { user: AuthUser | null; isAuthenticated: boolean }
|
||||
>(() => ({ user: buildUser({}), isAuthenticated: true }));
|
||||
vi.mock("@/hooks/use-auth", async () => {
|
||||
const actual =
|
||||
await vi.importActual<typeof import("@/hooks/use-auth")>(
|
||||
@@ -109,7 +105,10 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("<ModulesSection>", () => {
|
||||
it("renders a Switch for every non-delegated toggleable module, a managed deep-link for delegated ones, and locked switches for core", () => {
|
||||
it("renders a Switch for every non-delegated toggleable module and a managed deep-link for delegated ones", () => {
|
||||
// v1.18.6 (W9) — the "Always on" core-domains card was removed (a domain
|
||||
// that can't be turned off doesn't need listing), so this section now
|
||||
// only renders the toggleable modules.
|
||||
const html = render();
|
||||
for (const key of MODULE_KEYS) {
|
||||
if (moduleDelegatesTo(key) !== undefined) {
|
||||
@@ -126,8 +125,16 @@ describe("<ModulesSection>", () => {
|
||||
);
|
||||
}
|
||||
}
|
||||
for (const key of CORE_DOMAIN_KEYS) {
|
||||
expect(html, `core switch ${key}`).toContain(`id="module-toggle-${key}"`);
|
||||
});
|
||||
|
||||
it("no longer renders the 'Always on' core-domains card", () => {
|
||||
// v1.18.6 (W9) — the read-only core card (weight / BP / pulse) was
|
||||
// removed; the core domains are always active regardless.
|
||||
const html = render();
|
||||
for (const key of ["weight", "bloodPressure", "pulse"]) {
|
||||
expect(html, `core ${key} not rendered`).not.toContain(
|
||||
`id="module-toggle-${key}"`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -152,18 +159,6 @@ describe("<ModulesSection>", () => {
|
||||
expect(moodTag).toMatch(/data-state="checked"/);
|
||||
});
|
||||
|
||||
it("renders the core domains locked (checked + disabled)", () => {
|
||||
const html = render();
|
||||
for (const key of CORE_DOMAIN_KEYS) {
|
||||
const tag = html.match(
|
||||
new RegExp(`<button[^>]*id="module-toggle-${key}"[^>]*>`),
|
||||
)?.[0];
|
||||
expect(tag, `core ${key}`).toBeDefined();
|
||||
expect(tag).toMatch(/data-state="checked"/);
|
||||
expect(tag).toMatch(/disabled/);
|
||||
}
|
||||
});
|
||||
|
||||
it("PATCHes only the flipped key as a disabled-allowlist entry", async () => {
|
||||
render();
|
||||
expect(lastMutation?.mutationFn).toBeTypeOf("function");
|
||||
|
||||
@@ -131,12 +131,17 @@ vi.mock("@/hooks/use-auth", () => ({
|
||||
}));
|
||||
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import { SettingsSectionFrame } from "../settings-section-frame";
|
||||
import { MoodSection } from "../mood-section";
|
||||
|
||||
function render(locale: "en" | "de" = "en"): string {
|
||||
// v1.18.6 (W9) — the visible heading (with the historic id) comes from the
|
||||
// shared frame the route wraps the section in.
|
||||
return renderToStaticMarkup(
|
||||
<I18nProvider initialLocale={locale}>
|
||||
<MoodSection />
|
||||
<SettingsSectionFrame slug="mood">
|
||||
<MoodSection />
|
||||
</SettingsSectionFrame>
|
||||
</I18nProvider>,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
* v1.18.0 (S4) — module-gated per-type visibility on the consolidated
|
||||
* "Benachrichtigungen" reminder-types home.
|
||||
*
|
||||
* The mood reminder shows only when the `mood` module is enabled; the Coach
|
||||
* nudge only when `coach` is enabled. Low-stock maps to the medications CORE
|
||||
* domain (always shown). The gate fails OPEN, so a `/me` payload without a
|
||||
* module map keeps every card visible.
|
||||
* The mood reminder shows only when the `mood` module is enabled. Low-stock
|
||||
* maps to the medications domain (shown unless explicitly disabled). The gate
|
||||
* fails OPEN, so a `/me` payload without a module map keeps every card
|
||||
* visible.
|
||||
*
|
||||
* v1.18.6 (W9) — the proactive Coach nudge card moved to Settings → Coach, so
|
||||
* it no longer appears on this screen.
|
||||
*/
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
@@ -47,30 +50,23 @@ function render(modules?: Record<string, boolean>) {
|
||||
}
|
||||
|
||||
describe("<NotificationsSection> module-gated reminder types", () => {
|
||||
it("shows mood + coach cards when no module map (fails open)", () => {
|
||||
it("shows mood + low-stock cards when no module map (fails open); no coach nudge", () => {
|
||||
const html = render(undefined);
|
||||
expect(html).toContain('id="mood-reminder"');
|
||||
expect(html).toContain('id="coach-nudge"');
|
||||
expect(html).toContain('id="low-stock"');
|
||||
// v1.18.6 (W9) — the coach nudge moved to Settings → Coach.
|
||||
expect(html).not.toContain('id="coach-nudge"');
|
||||
});
|
||||
|
||||
it("hides the mood card when the mood module is disabled", () => {
|
||||
const html = render({ mood: false });
|
||||
expect(html).not.toContain('id="mood-reminder"');
|
||||
// Coach + low-stock are unaffected.
|
||||
expect(html).toContain('id="coach-nudge"');
|
||||
// Low-stock is unaffected.
|
||||
expect(html).toContain('id="low-stock"');
|
||||
});
|
||||
|
||||
it("hides the coach card when the coach module is disabled", () => {
|
||||
const html = render({ coach: false });
|
||||
expect(html).not.toContain('id="coach-nudge"');
|
||||
expect(html).toContain('id="mood-reminder"');
|
||||
expect(html).toContain('id="low-stock"');
|
||||
});
|
||||
|
||||
it("always shows low-stock (medications is a CORE domain)", () => {
|
||||
const html = render({ mood: false, coach: false });
|
||||
it("always shows low-stock unless medications is disabled", () => {
|
||||
const html = render({ mood: false });
|
||||
expect(html).toContain('id="low-stock"');
|
||||
expect(html).not.toContain('id="mood-reminder"');
|
||||
expect(html).not.toContain('id="coach-nudge"');
|
||||
@@ -82,9 +78,9 @@ describe("<NotificationsSection> module-gated reminder types", () => {
|
||||
const html = render({});
|
||||
expect(html).not.toContain('data-slot="notifications-channels-cross-link"');
|
||||
expect(html).not.toContain('data-slot="notifications-inbox-cross-link"');
|
||||
// The three reminder-type cards remain.
|
||||
// The remaining reminder-type cards (no coach nudge here anymore).
|
||||
expect(html).toContain('id="mood-reminder"');
|
||||
expect(html).toContain('id="low-stock"');
|
||||
expect(html).toContain('id="coach-nudge"');
|
||||
expect(html).not.toContain('id="coach-nudge"');
|
||||
});
|
||||
});
|
||||
@@ -2,11 +2,11 @@
|
||||
* v1.4.16 phase B6 — settings i18n parity.
|
||||
*
|
||||
* Every slug declared in `SETTINGS_SECTION_SLUGS` MUST have a
|
||||
* `settings.sections.<slug>.title` AND a `settings.sections.<slug>.description`
|
||||
* resolved in both English and German. The audit doc
|
||||
* (`docs/audit/v1416-settings-audit.md`) calls this out as the canonical
|
||||
* shape — the sidebar, the page `<h1>`, and the page subtitle all read
|
||||
* from these two keys, so a missing key paints a raw key in production.
|
||||
* `settings.sections.<slug>.title` AND a `settings.sections.<slug>.subtitle`
|
||||
* resolved in both English and German. The sidebar reads `.title`; the shared
|
||||
* `<SettingsSectionFrame>` reads `.title` + `.subtitle` for the visible page
|
||||
* heading + subheading (v1.18.6 W9), so a missing key paints a raw key in
|
||||
* production.
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
@@ -46,43 +46,39 @@ describe("settings sections — i18n parity (B6)", () => {
|
||||
expect(deValue?.length ?? 0).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it(`every locale resolves settings.sections.${slug}.description`, () => {
|
||||
it(`every locale resolves settings.sections.${slug}.subtitle`, () => {
|
||||
const enValue = lookup(en as Bag, [
|
||||
"settings",
|
||||
"sections",
|
||||
slug,
|
||||
"description",
|
||||
"subtitle",
|
||||
]);
|
||||
const deValue = lookup(de as Bag, [
|
||||
"settings",
|
||||
"sections",
|
||||
slug,
|
||||
"description",
|
||||
"subtitle",
|
||||
]);
|
||||
expect(enValue, `EN missing description for ${slug}`).toBeTypeOf(
|
||||
"string",
|
||||
);
|
||||
expect(enValue, `EN missing subtitle for ${slug}`).toBeTypeOf("string");
|
||||
expect(enValue?.length ?? 0).toBeGreaterThan(0);
|
||||
expect(deValue, `DE missing description for ${slug}`).toBeTypeOf(
|
||||
"string",
|
||||
);
|
||||
expect(deValue, `DE missing subtitle for ${slug}`).toBeTypeOf("string");
|
||||
expect(deValue?.length ?? 0).toBeGreaterThan(0);
|
||||
});
|
||||
}
|
||||
|
||||
it("EN and DE description for every slug are different (catches accidental copy-paste)", () => {
|
||||
it("EN and DE subtitle for every slug are different (catches accidental copy-paste)", () => {
|
||||
for (const slug of SETTINGS_SECTION_SLUGS) {
|
||||
const enValue = lookup(en as Bag, [
|
||||
"settings",
|
||||
"sections",
|
||||
slug,
|
||||
"description",
|
||||
"subtitle",
|
||||
]);
|
||||
const deValue = lookup(de as Bag, [
|
||||
"settings",
|
||||
"sections",
|
||||
slug,
|
||||
"description",
|
||||
"subtitle",
|
||||
]);
|
||||
// It's legitimate for some titles to coincide between locales when
|
||||
// the proper noun is the same (e.g. "Dashboard", "API & Tokens").
|
||||
@@ -90,7 +86,7 @@ describe("settings sections — i18n parity (B6)", () => {
|
||||
// EN value into the DE bag is a bug.
|
||||
expect(
|
||||
deValue,
|
||||
`DE description for ${slug} is identical to EN — needs translation`,
|
||||
`DE subtitle for ${slug} is identical to EN — needs translation`,
|
||||
).not.toBe(enValue);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -87,6 +87,8 @@ vi.mock("@/components/settings/thresholds-editor-section", () => ({
|
||||
ThresholdsEditorSection: () => <div data-testid="thresholds-editor" />,
|
||||
}));
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import { SettingsSectionFrame } from "../settings-section-frame";
|
||||
import type { SettingsSectionSlug } from "../section-slugs";
|
||||
import { AboutSection } from "../about-section";
|
||||
import { AccountSection } from "../account-section";
|
||||
import { AdvancedSection } from "../advanced-section";
|
||||
@@ -108,10 +110,25 @@ function render(node: React.ReactElement, locale: "en" | "de" = "en") {
|
||||
);
|
||||
}
|
||||
|
||||
// v1.18.6 (W9) — the visible page heading + subtitle moved out of the section
|
||||
// bodies into the shared `<SettingsSectionFrame>` that the route wraps every
|
||||
// section in. The heading-level smoke checks render the body THROUGH the frame
|
||||
// (mirroring production) so they assert what the user actually sees.
|
||||
function renderFramed(
|
||||
slug: SettingsSectionSlug,
|
||||
node: React.ReactElement,
|
||||
locale: "en" | "de" = "en",
|
||||
) {
|
||||
return render(
|
||||
<SettingsSectionFrame slug={slug}>{node}</SettingsSectionFrame>,
|
||||
locale,
|
||||
);
|
||||
}
|
||||
|
||||
describe("settings sections — SSR smoke", () => {
|
||||
it("<AccountSection> renders the Account heading and Profile card", () => {
|
||||
const html = render(<AccountSection />);
|
||||
// Section title resolves via the i18n provider.
|
||||
const html = renderFramed("account", <AccountSection />);
|
||||
// Section title resolves via the frame + i18n provider.
|
||||
expect(html).toContain("Account");
|
||||
// Profile card heading is also painted.
|
||||
expect(html).toContain("Profile");
|
||||
@@ -136,7 +153,7 @@ describe("settings sections — SSR smoke", () => {
|
||||
});
|
||||
|
||||
it("<AboutSection> renders version + license + sources/docs cards (no Updates panel)", () => {
|
||||
const html = render(<AboutSection />);
|
||||
const html = renderFramed("about", <AboutSection />);
|
||||
expect(html).toContain("About");
|
||||
// v1.4.36 W4f — the dedicated "Updates" card with its manual
|
||||
// "Check now" button is gone. The 24 h auto-check still runs and
|
||||
@@ -158,34 +175,33 @@ describe("settings sections — SSR smoke", () => {
|
||||
expect(html).not.toContain("Replay the tour");
|
||||
});
|
||||
|
||||
it("<AiSection> renders the AI Insights heading", () => {
|
||||
const html = render(<AiSection />);
|
||||
// v1.8.7.1 — section renamed to "AI Insights" so the AI nature of the
|
||||
// surface is explicit (was the bare "Insights"). The section H1 carries
|
||||
// the only heading.
|
||||
expect(html).toContain("AI Insights");
|
||||
it("<AiSection> renders the AI provider heading", () => {
|
||||
const html = renderFramed("ai", <AiSection />);
|
||||
// v1.18.6 (W9) — section renamed to "AI provider"; the visible heading
|
||||
// now comes from the shared frame, which keeps the historic id.
|
||||
expect(html).toContain("AI provider");
|
||||
expect(html).toContain("settings-section-ai-title");
|
||||
});
|
||||
|
||||
it("<IntegrationsSection> renders Withings card title", () => {
|
||||
const html = render(<IntegrationsSection />);
|
||||
const html = renderFramed("integrations", <IntegrationsSection />);
|
||||
expect(html).toContain("Integrations");
|
||||
expect(html).toContain("Withings");
|
||||
});
|
||||
|
||||
it("<NotificationsSection> renders the single reminder-types home", () => {
|
||||
const html = render(<NotificationsSection />);
|
||||
// v1.18.1 (D0/D5) — the screen is lean: sr-only h1 only, no section blurb,
|
||||
// no channels/inbox cross-links, and no embedded Vorsorge editor.
|
||||
const html = renderFramed("notifications", <NotificationsSection />);
|
||||
// v1.18.6 (W9) — the visible heading comes from the frame; the proactive
|
||||
// Coach nudge moved to Settings → Coach, so it no longer renders here.
|
||||
expect(html).toContain("settings-section-notifications-title");
|
||||
expect(html).not.toContain("Notification channels");
|
||||
expect(html).not.toContain('data-slot="notifications-channels-cross-link"');
|
||||
expect(html).not.toContain('data-slot="notifications-inbox-cross-link"');
|
||||
// The mood + coach cards fail OPEN (mock user carries no module map),
|
||||
// so all three reminder-type cards render.
|
||||
// The mood card fails OPEN (mock user carries no module map), so both
|
||||
// remaining reminder-type cards render. The coach-nudge card is gone.
|
||||
expect(html).toContain('id="mood-reminder"');
|
||||
expect(html).toContain('id="coach-nudge"');
|
||||
expect(html).toContain('id="low-stock"');
|
||||
expect(html).not.toContain('id="coach-nudge"');
|
||||
// No raw i18n key leaks past the provider.
|
||||
expect(html).not.toContain("settings.sections.notifications.");
|
||||
});
|
||||
@@ -194,32 +210,31 @@ describe("settings sections — SSR smoke", () => {
|
||||
// v1.4.3 split: the per-metric thresholds (Persönliche Zielwerte) moved
|
||||
// out into their own settings section under `/settings/thresholds`,
|
||||
// so the dashboard panel is now layout-only. Verifying the heading
|
||||
// says "Dashboard" (not "Übersicht" — the v1.4.2 placeholder) and the
|
||||
// layout slot still mounts.
|
||||
const html = render(<DashboardSection />);
|
||||
// (supplied by the frame) says "Dashboard" and the layout slot mounts.
|
||||
const html = renderFramed("dashboard", <DashboardSection />);
|
||||
expect(html).toContain("Dashboard");
|
||||
expect(html).toContain('data-testid="dashboard-layout"');
|
||||
expect(html).not.toContain('data-testid="thresholds"');
|
||||
});
|
||||
|
||||
it("<ApiSection> renders endpoints + tokens cards", () => {
|
||||
const html = render(<ApiSection />);
|
||||
const html = renderFramed("api", <ApiSection />);
|
||||
expect(html).toContain("API & Tokens");
|
||||
});
|
||||
|
||||
it("<AdvancedSection> renders the danger-zone card only (export moved to /settings/export)", () => {
|
||||
const html = render(<AdvancedSection />);
|
||||
const html = renderFramed("advanced", <AdvancedSection />);
|
||||
// v1.4.16 phase B7: every export path moved out into the dedicated
|
||||
// `<ExportSection>` so what remains is the irreversible delete-all
|
||||
// path. The section heading + dangerZone surface are the only
|
||||
// primary surfaces here now.
|
||||
// path. The heading (supplied by the frame) + dangerZone surface are the
|
||||
// only primary surfaces here now.
|
||||
expect(html).toContain("Advanced");
|
||||
expect(html).not.toContain("settings.export");
|
||||
expect(html).not.toContain("doctorReport");
|
||||
});
|
||||
|
||||
it("<AboutSection> resolves about.* keys in German", () => {
|
||||
const html = render(<AboutSection />, "de");
|
||||
const html = renderFramed("about", <AboutSection />, "de");
|
||||
// v1.4.36 W4f — "Updates" panel + "Jetzt prüfen" button removed;
|
||||
// the surviving German copy is the section title + the Sources
|
||||
// & docs heading + the version line.
|
||||
@@ -235,7 +250,7 @@ describe("settings sections — SSR smoke", () => {
|
||||
// `<ThresholdsEditorSection>` (was `<ThresholdsSection>`).
|
||||
// v1.8.7.1 — Sources split back onto its own page, so this wrapper
|
||||
// renders the target-range editor only.
|
||||
const html = render(<ThresholdsSection />);
|
||||
const html = renderFramed("thresholds", <ThresholdsSection />);
|
||||
// v1.8.7.1: section renamed to "Targets".
|
||||
expect(html).toContain("Targets");
|
||||
expect(html).toContain('data-testid="thresholds-editor"');
|
||||
@@ -244,7 +259,7 @@ describe("settings sections — SSR smoke", () => {
|
||||
});
|
||||
|
||||
it("<ThresholdsSection> resolves the German title", () => {
|
||||
const html = render(<ThresholdsSection />, "de");
|
||||
const html = renderFramed("thresholds", <ThresholdsSection />, "de");
|
||||
// v1.8.7.1 — German title is "Zielwerte" (Targets only).
|
||||
expect(html).toContain("Zielwerte");
|
||||
expect(html).toContain('data-testid="thresholds-editor"');
|
||||
|
||||
@@ -319,9 +319,9 @@ describe("<SettingsShell>", () => {
|
||||
expect(html).toContain('href="/settings/mood"');
|
||||
// Targets keeps its German nav entry ("Zielwerte").
|
||||
expect(html).toContain("Zielwerte");
|
||||
// v1.8.7.1 — the AI Insights section is named "KI-Auswertungen" in
|
||||
// German (the "KI" prefix makes the AI nature explicit).
|
||||
expect(html).toContain("KI-Auswertungen");
|
||||
// v1.18.6 (W9) — the AI section is named "KI-Anbieter" in German: the
|
||||
// page is about the provider / BYOK, not an "Auswertung".
|
||||
expect(html).toContain("KI-Anbieter");
|
||||
// API & Tokens is identical in both locales (proper noun + ampersand)
|
||||
expect(html).toContain("API & Tokens");
|
||||
expect(html).toContain("Erweitert");
|
||||
|
||||
Reference in new issue
Block a user