fix: fix cell border radius on soft focus (#649)
* refactor: add RootDecorator * docs: add EditableCellText stories --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { userEvent, within } from '@storybook/testing-library';
|
||||
|
||||
import {
|
||||
CellPositionDecorator,
|
||||
ComponentDecorator,
|
||||
} from '~/testing/decorators';
|
||||
|
||||
import { EditableCellText } from '../types/EditableCellText';
|
||||
|
||||
const meta: Meta<typeof EditableCellText> = {
|
||||
title: 'UI/EditableCell/EditableCellText',
|
||||
component: EditableCellText,
|
||||
decorators: [ComponentDecorator, CellPositionDecorator],
|
||||
args: {
|
||||
value: 'Content',
|
||||
},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
type Story = StoryObj<typeof EditableCellText>;
|
||||
|
||||
export const DisplayMode: Story = {
|
||||
render: EditableCellText,
|
||||
};
|
||||
|
||||
export const SoftFocusMode: Story = {
|
||||
...DisplayMode,
|
||||
play: async ({ canvasElement, step }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await step('Click once', () =>
|
||||
userEvent.click(canvas.getByText('Content')),
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const EditMode: Story = {
|
||||
...DisplayMode,
|
||||
play: async ({ canvasElement, step }) => {
|
||||
const canvas = within(canvasElement);
|
||||
const click = async () => userEvent.click(canvas.getByText('Content'));
|
||||
|
||||
await step('Click once', click);
|
||||
await step('Click twice', click);
|
||||
},
|
||||
};
|
||||
@ -2,9 +2,9 @@ import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { userEvent, within } from '@storybook/testing-library';
|
||||
|
||||
import { IconList } from '@/ui/icons/index';
|
||||
import { availableSorts } from '~/pages/companies/companies-sorts';
|
||||
import { getRenderWrapperForEntityTableComponent } from '~/testing/renderWrappers';
|
||||
|
||||
import { availableSorts } from '../../../../../../pages/companies/companies-sorts';
|
||||
import { TableHeader } from '../TableHeader';
|
||||
|
||||
const meta: Meta<typeof TableHeader> = {
|
||||
|
||||
Reference in New Issue
Block a user