import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import { createKcPageStory } from "../KcPageStory"; const { KcPageStory } = createKcPageStory({ pageId: "login-password.ftl" }); const meta = { title: "login/login-password.ftl", component: KcPageStory } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { render: () => }; /** * WithPasswordError: * - Purpose: Tests the behavior when an error occurs in the password field (e.g., incorrect password). * - Scenario: Simulates a scenario where an invalid password is entered, and an error message is displayed. * - Key Aspect: Ensures that the password input field displays error messages correctly. */ export const WithPasswordError: Story = { render: () => ( field === "password", get: () => "Invalid password" } }} /> ) }; /** * WithoutResetPasswordOption: * - Purpose: Tests the behavior when the reset password option is disabled. * - Scenario: Simulates a scenario where the `resetPasswordAllowed` is set to `false`, and the "Forgot Password" link is not rendered. * - Key Aspect: Ensures that the component handles cases where resetting the password is not allowed. */ export const WithoutResetPasswordOption: Story = { render: () => ( false } }} /> ) };