diff --git a/src/formio/components/composite.stories.js b/src/formio/components/composite.stories.js index afaa57ca8..fb58b6a84 100644 --- a/src/formio/components/composite.stories.js +++ b/src/formio/components/composite.stories.js @@ -1,3 +1,4 @@ +import {expect} from '@storybook/jest'; import {userEvent, within} from '@storybook/testing-library'; import {withUtrechtDocument} from 'story-utils/decorators'; @@ -14,6 +15,7 @@ export default { type: 'textfield', key: 'textfield', label: 'Required text field', + description: 'Text field description', validate: { required: true, pattern: '^\\d+', @@ -38,6 +40,12 @@ export default { html: '
Some WYSIWYG content
', customClass: 'info', }, + { + type: 'textfield', + key: 'hiddenTextfield', + label: 'Hidden text field', + hidden: true, + }, { label: 'Submit', showValidations: false, @@ -57,6 +65,17 @@ export default { }, }; +export const Pristine = { + render: MultipleFormioComponents, + + play: async ({canvasElement}) => { + const canvas = within(canvasElement); + + expect(canvas.queryByText('Required text field')).toBeVisible(); + expect(canvas.queryByText('Hidden text field')).not.toBeInTheDocument(); + }, +}; + export const WithValidationErrors = { render: args => ( );