2023-04-20 05:41:34 +02:00
|
|
|
import React from "react";
|
2024-06-03 00:11:19 +02:00
|
|
|
import type { Meta, StoryObj } from "@storybook/react";
|
2024-06-09 11:53:25 +02:00
|
|
|
import { createKcPageStory } from "../KcPageStory";
|
2023-04-20 05:41:34 +02:00
|
|
|
|
2024-06-09 11:53:25 +02:00
|
|
|
const { KcPageStory } = createKcPageStory({ pageId: "login-page-expired.ftl" });
|
2023-04-20 05:41:34 +02:00
|
|
|
|
2024-06-03 00:11:19 +02:00
|
|
|
const meta = {
|
2024-06-06 07:28:34 +02:00
|
|
|
title: "login/login-page-expired.ftl",
|
2024-06-09 11:53:25 +02:00
|
|
|
component: KcPageStory
|
|
|
|
} satisfies Meta<typeof KcPageStory>;
|
2023-04-20 05:41:34 +02:00
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
2024-06-03 00:11:19 +02:00
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
export const Default: Story = {
|
2024-06-09 11:53:25 +02:00
|
|
|
render: () => <KcPageStory />
|
2024-06-03 00:11:19 +02:00
|
|
|
};
|
2024-10-19 17:24:29 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* WithErrorMessage:
|
|
|
|
* - Purpose: Tests behavior when an error message is displayed along with the page expiration message.
|
|
|
|
* - Scenario: Simulates a case where the session expired due to an error, and an error message is displayed alongside the expiration message.
|
|
|
|
* - Key Aspect: Ensures that error messages are displayed correctly in addition to the page expiration notice.
|
|
|
|
*/
|
|
|
|
export const WithErrorMessage: Story = {
|
|
|
|
render: () => (
|
|
|
|
<KcPageStory
|
|
|
|
kcContext={{
|
|
|
|
url: {
|
|
|
|
loginRestartFlowUrl: "/mock-restart-flow",
|
|
|
|
loginAction: "/mock-continue-login"
|
|
|
|
},
|
|
|
|
message: {
|
|
|
|
type: "error",
|
|
|
|
summary: "An error occurred while processing your session."
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
};
|