keycloak_theme/stories/login/pages/LoginRecoveryAuthnCodeConfig.stories.tsx

41 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-06-03 01:23:28 +02:00
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
2024-06-09 11:53:25 +02:00
import { createKcPageStory } from "../KcPageStory";
2024-06-03 01:23:28 +02:00
2024-06-09 11:53:25 +02:00
const { KcPageStory } = createKcPageStory({ pageId: "login-recovery-authn-code-config.ftl" });
2024-06-03 01:23:28 +02:00
const meta = {
2024-06-06 07:28:34 +02:00
title: "login/login-recovery-authn-code-config.ftl",
2024-06-09 11:53:25 +02:00
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;
2024-06-03 01:23:28 +02:00
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
2024-06-09 11:53:25 +02:00
render: () => <KcPageStory />
2024-06-03 01:23:28 +02:00
};
2024-10-19 17:24:29 -04:00
/**
* WithErrorDuringCodeGeneration:
* - Purpose: Tests when an error occurs while generating recovery authentication codes.
* - Scenario: The component renders an error message to inform the user of the failure during code generation.
* - Key Aspect: Ensures that error messages are properly displayed when recovery code generation fails.
*/
export const WithErrorDuringCodeGeneration: Story = {
render: () => (
<KcPageStory
kcContext={{
url: {
loginAction: "/mock-login-action"
},
message: {
summary: "An error occurred during recovery code generation. Please try again.",
type: "error"
}
}}
/>
)
};