diff --git a/src/components/ComponentConfiguration.stories.tsx b/src/components/ComponentConfiguration.stories.tsx index aa072e65..025574cb 100644 --- a/src/components/ComponentConfiguration.stories.tsx +++ b/src/components/ComponentConfiguration.stories.tsx @@ -1708,7 +1708,7 @@ export const Address: Story = { }, builderInfo: { title: 'Address Field', - icon: 'gome', + icon: 'home', group: 'basic', weight: 10, schema: {}, diff --git a/src/components/formio/fieldset.stories.tsx b/src/components/formio/fieldset.stories.tsx index 9bd78925..bdf7eff4 100644 --- a/src/components/formio/fieldset.stories.tsx +++ b/src/components/formio/fieldset.stories.tsx @@ -1,5 +1,5 @@ import {expect} from '@storybook/jest'; -import {Meta, StoryFn, StoryObj} from '@storybook/react'; +import {Meta, StoryObj} from '@storybook/react'; import {within} from '@storybook/testing-library'; import {withFormik} from '@/sb-decorators'; @@ -12,58 +12,46 @@ export default { decorators: [withFormik], parameters: { modal: {noModal: true}, - // https://github.com/bbbtech/storybook-formik/issues/51#issuecomment-1136668271 - docs: { - inlineStories: false, - iframeHeight: 150, - }, }, args: { type: 'textfield', + children: '', }, } as Meta; type Story = StoryObj; -const Template: StoryFn = args => ( -
-
{args.children || ''}
-
-); - export const WithoutLabel: Story = { - render: Template, - args: { label: '', }, }; export const WithToolTip: Story = { - render: Template, - args: { label: 'With tooltip', tooltip: 'Hiya!', }, }; -export const WithErrors: Story = Template.bind([]); -WithErrors.parameters = { - formik: { - initialValues: {someField: ''}, - initialErrors: {someField: 'Some error'}, +export const WithErrors: Story = { + parameters: { + formik: { + initialValues: {someField: ''}, + initialErrors: {someField: 'Some error'}, + }, + }, + args: { + label: 'Errors must be displayed', + children: , + field: 'someField', + }, + argTypes: { + children: {table: {disable: true}}, + }, + + play: async ({canvasElement}) => { + const canvas = within(canvasElement); + await expect(canvas.queryByText('Some error')).toBeInTheDocument(); }, -}; -WithErrors.args = { - label: 'Errors must be displayed', - children: , - field: 'someField', -}; -WithErrors.argTypes = { - children: {table: {disable: true}}, -}; -WithErrors.play = async ({canvasElement}) => { - const canvas = within(canvasElement); - await expect(canvas.queryByText('Some error')).toBeInTheDocument(); };