diff --git a/stories/account/pages/Account.stories.tsx b/stories/account/pages/Account.stories.tsx index 04e654d2..4eac998c 100644 --- a/stories/account/pages/Account.stories.tsx +++ b/stories/account/pages/Account.stories.tsx @@ -16,3 +16,105 @@ type Story = StoryObj; export const Default: Story = { render: () => }; + +/** + * UsernameNotEditable: + * - Purpose: Test the scenario where the username field is not editable. + * - Scenario: The component renders, but the username field is disabled. + * - Key Aspect: Ensures that the `editUsernameAllowed` condition is respected and the username field is read-only. + */ +export const UsernameNotEditable: Story = { + render: () => ( + "" + }, + stateChecker: "state-checker" + }} + /> + ) +}; + +/** + * WithValidationErrors: + * - Purpose: Test the form when there are validation errors. + * - Scenario: The component renders with error messages for invalid input in the fields. + * - Key Aspect: Ensures that error messages are properly displayed and the user can correct their inputs. + */ +export const WithValidationErrors: Story = { + render: () => ( + (field === "email" || field === "firstName" ? "has-error" : "") + }, + stateChecker: "state-checker" + }} + /> + ) +}; +/** + * EmailAsUsername: + * - Purpose: Test the form where email is used as the username. + * - Scenario: The component renders without a separate username field, and the email field is treated as the username. + * - Key Aspect: Ensures the form functions correctly when `registrationEmailAsUsername` is enabled. + */ +export const EmailAsUsername: Story = { + render: () => ( + "" + }, + stateChecker: "state-checker" + }} + /> + ) +}; diff --git a/stories/account/pages/Applications.stories.tsx b/stories/account/pages/Applications.stories.tsx index c531c03d..e0b85893 100644 --- a/stories/account/pages/Applications.stories.tsx +++ b/stories/account/pages/Applications.stories.tsx @@ -78,3 +78,151 @@ export const Default: Story = { /> ) }; + +// No Available Roles or Grants Scenario +export const NoAvailableRolesOrGrants: Story = { + render: () => ( + + ) +}; + +// Consent Not Required Scenario +export const ConsentNotRequired: Story = { + render: () => ( + + ) +}; + +// No Roles Available but Consent Required Scenario +export const NoRolesButConsentRequired: Story = { + render: () => ( + + ) +}; + +// Only Resource Roles Available Scenario +export const OnlyResourceRolesAvailable: Story = { + render: () => ( + + ) +}; + +// No Additional Grants Scenario +export const NoAdditionalGrants: Story = { + render: () => ( + + ) +}; diff --git a/stories/account/pages/FederatedIdentity.stories.tsx b/stories/account/pages/FederatedIdentity.stories.tsx index ccb29405..86c556fc 100644 --- a/stories/account/pages/FederatedIdentity.stories.tsx +++ b/stories/account/pages/FederatedIdentity.stories.tsx @@ -36,3 +36,61 @@ export const NotConnected: Story = { /> ) }; + +/** + * RemoveLinkNotPossible: + * - Federated identities are connected, but the user cannot remove them due to restrictions. + */ +export const RemoveLinkNotPossible: Story = { + render: () => ( + + ) +}; + +/** + * AddLinkForUnconnectedIdentity: + * - The user has an identity that is not connected and can add it. + */ +export const AddLinkForUnconnectedIdentity: Story = { + render: () => ( + + ) +}; diff --git a/stories/account/pages/Log.stories.tsx b/stories/account/pages/Log.stories.tsx index 6b9ba1b4..754f19fc 100644 --- a/stories/account/pages/Log.stories.tsx +++ b/stories/account/pages/Log.stories.tsx @@ -355,3 +355,107 @@ export const Default: Story = { /> ) }; +export const LogsMissingDetails: Story = { + render: () => ( + + ) +}; +export const SingleLogEntry: Story = { + render: () => ( + + ) +}; +export const LogsWithLongDetails: Story = { + render: () => ( + + ) +}; +export const EmptyClientField: Story = { + render: () => ( + + ) +}; +export const NoLogsAvailable: Story = { + render: () => ( + + ) +}; diff --git a/stories/account/pages/Password.stories.tsx b/stories/account/pages/Password.stories.tsx index b9632bd9..7cd7efbf 100644 --- a/stories/account/pages/Password.stories.tsx +++ b/stories/account/pages/Password.stories.tsx @@ -26,3 +26,79 @@ export const WithMessage: Story = { /> ) }; +/** + * 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: () => ( + + ) +}; diff --git a/stories/account/pages/Sessions.stories.tsx b/stories/account/pages/Sessions.stories.tsx index 434622f5..8e86b344 100644 --- a/stories/account/pages/Sessions.stories.tsx +++ b/stories/account/pages/Sessions.stories.tsx @@ -57,3 +57,97 @@ export const WithError: Story = { /> ) }; +/** + * No active sessions scenario: + * - Simulates the scenario where no sessions are active for the user. + */ +export const NoActiveSessions: Story = { + render: () => ( + + ) +}; + +/** + * Single session scenario: + * - Displays only one active session with session details. + */ +export const SingleSession: Story = { + render: () => ( + + ) +}; + +/** + * Multiple clients per session scenario: + * - Displays sessions where each session has multiple associated clients. + */ +export const MultipleClientsSession: Story = { + render: () => ( + + ) +}; + +/** + * Session without client details scenario: + * - Simulates a session where no client information is provided. + */ +export const SessionWithoutClients: Story = { + render: () => ( + + ) +}; diff --git a/stories/account/pages/Totp.stories.tsx b/stories/account/pages/Totp.stories.tsx index 1ad1f027..84e060f9 100644 --- a/stories/account/pages/Totp.stories.tsx +++ b/stories/account/pages/Totp.stories.tsx @@ -180,3 +180,64 @@ export const MoreThanOneTotpProviders: Story = { /> ) }; + +// TOTP Enabled but No Existing OTP Credentials +export const TotpEnabledNoOtpCredentials: Story = { + render: () => ( + + ) +}; + +// Manual Mode TOTP without Scanning +export const ManualModeTotp: Story = { + render: () => ( + + ) +}; + +// Multiple OTP Devices Scenario +export const MultipleOtpDevices: Story = { + render: () => ( + + ) +};