mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 06:32:03 +00:00
Promote the Medikamente section from a hidden Layout-hub child to its own standalone nav entry (always shown — medications is a CORE domain) and gather the injection-site exclusions card here from the account profile, so every medication-specific preference lives on one screen. The Layout hub keeps only the dashboard + insights arrangement editors. The low-stock card stays whole in Notifications: its runway config and the low-stock reminder toggle are one tightly-coupled control writing a single prefs row, so splitting only the config out would break the card.
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
/**
|
|
* v1.17.1 (F-2) — the "Layout & Personalization" hub.
|
|
*
|
|
* The hub is the single front door for the four personalization editors.
|
|
* It must link to each of them with consistent framing so the concept
|
|
* reads as one home rather than four scattered settings sections.
|
|
*/
|
|
import { describe, expect, it } from "vitest";
|
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
|
|
import { I18nProvider } from "@/lib/i18n/context";
|
|
import { LayoutSection } from "../layout-section";
|
|
|
|
function render(locale: "en" | "de" = "en") {
|
|
return renderToStaticMarkup(
|
|
<I18nProvider initialLocale={locale}>
|
|
<LayoutSection />
|
|
</I18nProvider>,
|
|
);
|
|
}
|
|
|
|
describe("<LayoutSection>", () => {
|
|
it("links to the arrangement editors it still hosts", () => {
|
|
const html = render();
|
|
for (const href of ["/settings/dashboard", "/settings/insights"]) {
|
|
expect(html).toContain(`href="${href}"`);
|
|
}
|
|
// v1.18.0 (S5) — Medications (Medikamente) and Mood (Stimmung)
|
|
// graduated to their own nav entries and are no longer linked here.
|
|
expect(html).not.toContain('href="/settings/medications"');
|
|
expect(html).not.toContain('href="/settings/mood"');
|
|
});
|
|
|
|
it("renders the hub heading and a card per editor", () => {
|
|
const html = render();
|
|
expect(html).toContain("Dashboard");
|
|
expect(html).toContain("Insights");
|
|
});
|
|
|
|
it("resolves its copy in German too", () => {
|
|
const html = render("de");
|
|
expect(html).toContain("Layout");
|
|
expect(html).not.toContain("settings.sections.layout.");
|
|
});
|
|
});
|