Fix info.ftl page rendering in storybook

This commit is contained in:
Joseph Garrone 2023-11-07 16:33:19 +01:00
parent c8b85c43aa
commit c41eae63e7
2 changed files with 14 additions and 2 deletions

View File

@ -8,7 +8,10 @@ export default function Info(props: PageProps<Extract<KcContext, { pageId: "info
const { msgStr, msg } = i18n; const { msgStr, msg } = i18n;
assert(kcContext.message !== undefined); assert(
kcContext.message !== undefined,
"No message in kcContext.message, there will always be a message in production context, add it in your mock"
);
const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext; const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;

View File

@ -21,4 +21,13 @@ const meta: ComponentMeta<any> = {
export default meta; export default meta;
export const Default = () => <PageStory />; export const Default = () => (
<PageStory
kcContext={{
message: {
summary: "This is the server message",
type: "info"
}
}}
/>
);