feat(housekeeping): compose operations workspace
CI / check (pull_request) Successful in 37s
CI / release (pull_request) Skipped
CI / deploy (pull_request) Skipped

This commit is contained in:
Simo committed 2026-08-30 17:23:55 +02:00
1 parent 5574e601bb
commit 85ad0452d3
22 files changed
+1240 -87

No files matched your search

@@ -2,6 +2,7 @@ import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it, vi } from "vitest";
import type { HousekeepingSurface } from "../contracts";
import type { HousekeepingNavigationDomain } from "../navigation";
import { HousekeepingShell } from "./housekeeping-shell";
@@ -147,6 +148,7 @@ const componentBoundaryRules = [
function renderShell(
activeDomainId: HousekeepingNavigationDomain["id"] = "operations",
availableDomains: readonly HousekeepingNavigationDomain[] = domains,
surface: HousekeepingSurface = "preview",
): string {
return renderToStaticMarkup(
<HousekeepingShell
@@ -154,6 +156,7 @@ function renderShell(
activeDomainId={activeDomainId}
domains={availableDomains}
labels={labels}
surface={surface}
>
<p>Deck body</p>
</HousekeepingShell>,
@@ -230,6 +233,13 @@ describe("HousekeepingShell", () => {
}
});
it("only marks the preview surface as preview", () => {
expect(renderShell()).toContain(">Preview<");
expect(renderShell("operations", domains, "canonical")).not.toContain(
">Preview<",
);
});
it("does not throw or render contextual items when a valid active domain is absent", () => {
const domainsWithoutSystem = domains.filter(
(domain) => domain.id !== "system",