import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { createKcPageStory } from "../KcPageStory"; const { KcPageStory } = createKcPageStory({ pageId: "webauthn-error.ftl" }); const meta = { title: "login/webauthn-error.ftl", component: KcPageStory } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: () => }; /** * WithRetryAvailable: * - Purpose: Tests when the user can retry the WebAuthn authentication after an error. * - Scenario: The component renders with a "Try Again" button to allow retrying the authentication process. * - Key Aspect: Ensures the retry button functionality is visible and the user can retry authentication. */ export const WithRetryAvailable: Story = { render: () => ( ) }; /** * WithAppInitiatedAction: * - Purpose: Tests when the WebAuthn error form is part of an application-initiated action. * - Scenario: The component renders with both a "Try Again" button and a "Cancel" button for app-initiated actions. * - Key Aspect: Ensures the form renders correctly with both "Try Again" and "Cancel" options. */ export const WithAppInitiatedAction: Story = { render: () => ( ) }; /** * WithJavaScriptDisabled: * - Purpose: Tests the behavior when JavaScript is disabled or not functioning. * - Scenario: The component renders with a message prompting the user to retry manually without JavaScript. * - Key Aspect: Ensures the retry mechanism works properly when JavaScript is disabled or unavailable. */ export const WithJavaScriptDisabled: Story = { render: () => ( ) };