test(webui): cover View-focused Quick Access catalogues

This commit is contained in:
2026-08-19 20:14:02 +02:00
parent d600bca374
commit 94c94fefb4
3 changed files with 170 additions and 39 deletions
+49 -3
View File
@@ -31,7 +31,7 @@ import {
createQuickAccessLaunchContext,
quickAccessLaunchState
} from "../src/platform/launchContext";
import type { ApiSettings, AuthInfo, QuickAccessToolMetadata } from "../src/types";
import type { ApiSettings, AuthInfo, EffectiveViewProjection, QuickAccessToolMetadata } from "../src/types";
export default function ConformanceApp() {
const location = useLocation();
@@ -172,6 +172,20 @@ export default function ConformanceApp() {
function QuickAccessScenario() {
const location = useLocation();
const mode = new URLSearchParams(location.search).get("quick-access");
const viewContext = useMemo(
() => mode === "focused" || mode === "stale-focus"
? {
...CONFORMANCE_VIEW_PROJECTION,
presentation: {
quickAccessFocusedToolIds: mode === "focused"
? ["files.recent"]
: ["mail.compose"]
}
}
: null,
[mode]
);
const launchContext = useMemo(() => createQuickAccessLaunchContext({
pathname: location.pathname,
search: location.search,
@@ -185,8 +199,9 @@ function QuickAccessScenario() {
tenantId: "tenant-1",
label: "RPP-2026-0001 · Anwohnerparkausweis"
},
temporalContext: { validityMode: "current", validAt: null, recordedAt: null }
}), [location.hash, location.pathname, location.search]);
temporalContext: { validityMode: "current", validAt: null, recordedAt: null },
viewContext
}), [location.hash, location.pathname, location.search, viewContext]);
return <QuickAccessRail
settings={CONFORMANCE_SETTINGS}
auth={CONFORMANCE_AUTH}
@@ -272,8 +287,39 @@ const CONFORMANCE_QUICK_ACCESS_TOOLS: QuickAccessToolMetadata[] = [{
acceptedReferenceKinds: [],
returnedReferenceKinds: ["files.file-version"],
helpContextId: "files.quick_access.files"
}, {
contractVersion: "1",
id: "postbox.unread",
moduleId: "postbox",
categoryId: "messages",
label: "Unread messages",
description: "Open an authorized unread message.",
iconName: "messages",
surfaceId: "postbox.route.postbox",
fullPagePath: "/postbox",
allOf: [],
anyOf: [],
order: 10,
defaultEnabled: true,
modes: ["view"],
availability: "global",
acceptedReferenceKinds: [],
returnedReferenceKinds: ["postbox.message"],
helpContextId: "postbox.quick_access.messages"
}];
const CONFORMANCE_VIEW_PROJECTION: EffectiveViewProjection = {
activeViewId: "case-processing",
activeRevisionId: "case-processing-r4",
activeViewName: "Case processing",
visibleSurfaceIds: [],
projectionActive: true,
locked: false,
availableViews: [],
provenance: [{ source: "tenant-default", scopeType: "tenant", scopeId: "tenant-1" }],
diagnostics: []
};
function browserHistoryIndex(): number | null {
const value = (window.history.state as { idx?: unknown } | null)?.idx;
return typeof value === "number" && Number.isInteger(value) ? value : null;