feat(housekeeping): compose operations workspace
This commit is contained in:
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",
|
||||
|
||||
Reference in new issue
Block a user