storybooks second release
This commit is contained in:
@ -16,3 +16,47 @@ type Story = StoryObj<typeof meta>;
|
||||
export const Default: Story = {
|
||||
render: () => <KcPageStory />
|
||||
};
|
||||
|
||||
/**
|
||||
* WithErrorMessage:
|
||||
* - Purpose: Tests when there is an error with the OAuth2 device user code entry.
|
||||
* - Scenario: The component renders with an error message displayed to the user.
|
||||
* - Key Aspect: Ensures the error message is properly shown when the user enters an invalid code.
|
||||
*/
|
||||
export const WithErrorMessage: Story = {
|
||||
render: () => (
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
url: {
|
||||
oauth2DeviceVerificationAction: "/mock-oauth2-device-verification"
|
||||
},
|
||||
message: {
|
||||
summary: "The user code you entered is invalid. Please try again.",
|
||||
type: "error"
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
};
|
||||
|
||||
/**
|
||||
* WithEmptyInputField:
|
||||
* - Purpose: Tests when the user code field is left empty.
|
||||
* - Scenario: The component renders the form, and the user tries to submit without entering any code.
|
||||
* - Key Aspect: Ensures the form displays validation errors when the field is left empty.
|
||||
*/
|
||||
export const WithEmptyInputField: Story = {
|
||||
render: () => (
|
||||
<KcPageStory
|
||||
kcContext={{
|
||||
url: {
|
||||
oauth2DeviceVerificationAction: "/mock-oauth2-device-verification"
|
||||
},
|
||||
message: {
|
||||
summary: "User code cannot be empty. Please enter a valid code.",
|
||||
type: "error"
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
};
|
||||
|
Reference in New Issue
Block a user