feat(webui): open contextual configured handbooks
This commit is contained in:
18
webui/tests/help-context.test.ts
Normal file
18
webui/tests/help-context.test.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { helpContextForPathname } from "../src/utils/helpContext";
|
||||
|
||||
function assertEqual(actual: string, expected: string, message: string): void {
|
||||
if (actual !== expected) throw new Error(`${message}: expected ${expected}, got ${actual}`);
|
||||
}
|
||||
|
||||
assertEqual(helpContextForPathname("/files").id, "files.list", "Files context");
|
||||
assertEqual(helpContextForPathname("/mail").id, "mail.list", "Mail context");
|
||||
assertEqual(
|
||||
helpContextForPathname("/settings", "?section=mail-profiles").id,
|
||||
"mail.profiles",
|
||||
"Mail profile settings context"
|
||||
);
|
||||
assertEqual(
|
||||
helpContextForPathname("/campaigns/campaign-1/attachments").id,
|
||||
"campaign.attachments",
|
||||
"Campaign attachment context"
|
||||
);
|
||||
Reference in New Issue
Block a user