1
0
Fork 0
Anvil/stories/pages/Login.stories.ts
André Jaenisch 390c54a2bf
docs: create stories for Login page
This is the second form I have touched. Here, I even have a light
validation implemented on the server.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00

45 lines
732 B
TypeScript

import type { Meta, StoryObj } from '@storybook/svelte';
import Login from '$lib/components/pages/Login.svelte';
const meta = {
title: 'Pages/Login',
component: Login,
tags: ['autodocs'],
argTypes: {
form: { controls: 'object' }
}
} satisfies Meta<Login>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Plain: Story = {
args: {
form: {
account: 'jane.doe@domain.example',
incorrect: false,
missing: false,
}
}
};
export const MissingInput: Story = {
args: {
form: {
account: '',
incorrect: false,
missing: true,
}
}
};
export const InvalidFormData: Story = {
args: {
form: {
account: 'jane.doe@domain.example',
incorrect: true,
missing: false,
}
}
};