Skip to content

Commit

Permalink
✅ [#4606] Amend stories for ZGW registration options
Browse files Browse the repository at this point in the history
* Added case with validation errors
* Added some more options to confidentiality level select
  • Loading branch information
sergei-maertens committed Aug 19, 2024
1 parent 00bd426 commit 9c4b1ec
Showing 1 changed file with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ import {
mockObjecttypeVersionsGet,
mockObjecttypesGet,
} from 'components/admin/form_design/registrations/objectsapi/mocks';
import {ValidationErrorsDecorator} from 'components/admin/form_design/story-decorators';
import {
FormDecorator,
ValidationErrorsDecorator,
} from 'components/admin/form_design/story-decorators';

import RegistrationFields from './RegistrationFields';

export default {
title: 'Form design / Registration / RegistrationFields',
decorators: [ValidationErrorsDecorator],
decorators: [ValidationErrorsDecorator, FormDecorator],
component: RegistrationFields,
args: {
availableBackends: [
Expand Down Expand Up @@ -43,8 +46,8 @@ export default {
enumNames: ['ZGW API group 1'],
},
zaakVertrouwelijkheidaanduiding: {
enum: ['openbaar'],
enumNames: ['Openbaar'],
enum: ['openbaar', 'geheim'],
enumNames: ['Openbaar', 'Geheim'],
},
},
},
Expand Down Expand Up @@ -171,6 +174,14 @@ export default {
onChange: fn(),
addBackend: fn(),
onDelete: fn(),
availableComponents: {
textField1: {
label: 'textfield1',
},
textField2: {
label: 'textfield2',
},
},
},
parameters: {
msw: {
Expand Down Expand Up @@ -270,6 +281,7 @@ export const ConfiguredBackends = {
},
],
validationErrors: [
['form.registrationBackends.1.options.zgwApiGroup', 'You sure about this?'],
['form.registrationBackends.3.options.objectsApiGroup', 'You shall not pass.'],
],
},
Expand Down Expand Up @@ -411,4 +423,10 @@ export const ZGW = {
},
],
},

play: async ({canvasElement}) => {
const canvas = within(canvasElement);

await userEvent.click(canvas.getByRole('button', {name: 'Opties instellen'}));
},
};

0 comments on commit 9c4b1ec

Please sign in to comment.