import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { createKcPageStory } from "../KcPageStory"; const { KcPageStory } = createKcPageStory({ pageId: "password.ftl" }); const meta = { title: "account/password.ftl", component: KcPageStory } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: () => }; export const WithMessage: Story = { render: () => ( ) }; /** * FirstTimePasswordSetup: * - Purpose: Tests the page when no password is set (e.g., first login). * - Scenario: This renders the form without the current password field. * - Key Aspect: Ensures the page only displays fields for setting a new password. */ export const FirstTimePasswordSetup: Story = { render: () => ( ) }; /** * IncorrectCurrentPassword: * - Purpose: Simulates validation error when the current password is incorrect. * - Scenario: This renders the page with an error message indicating the current password is incorrect. * - Key Aspect: Validates that an error message is correctly displayed for the current password input. */ export const IncorrectCurrentPassword: Story = { render: () => ( ) }; /** * SubmissionSuccessWithRedirect: * - Purpose: Simulates a successful form submission with a redirect or success message. * - Scenario: After successfully changing the password, a success message and redirect behavior are triggered. * - Key Aspect: Verifies the handling of successful submissions. */ export const SubmissionSuccessWithRedirect: Story = { render: () => ( ) };