Skip to content

Commit

Permalink
✅ [#4524] Updated VariableSelection.stories.js
Browse files Browse the repository at this point in the history
Added sources and formDefinitions. This allows for the testing of the new VariableSelection react-select grouping
  • Loading branch information
robinmolen committed Oct 2, 2024
1 parent 31c7f1d commit fa5166f
Showing 1 changed file with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {useArgs} from '@storybook/preview-api';
import {FormDecorator} from 'components/admin/form_design/story-decorators';

import VariableSelection from './VariableSelection';
import {VARIABLE_SOURCES} from '../form_design/variables/constants';

const render = ({name, includeStaticVariables, filter}) => {
const [{value}, updateArgs] = useArgs();
Expand Down Expand Up @@ -31,11 +32,17 @@ export default {

availableFormSteps: [
{
configuration: {
display: 'form',
},

formDefinition: 'foo',
name: 'foo',
slug: '',
url: '',
_generatedId: '',
isNew: true,
validationErrors: [],
},
{
formDefinition: 'bar',
name: 'bar',
slug: '',
url: '',
_generatedId: '',
Expand All @@ -56,9 +63,24 @@ export default {
availableFormVariables: [
{
form: 'bar',
formDefinition: 'bar',
formDefinition: 'foo',
name: 'name2',
key: 'key2',
source: VARIABLE_SOURCES.component,
},
{
form: 'bar',
formDefinition: 'bar',
name: 'name3',
key: 'key3',
source: VARIABLE_SOURCES.userDefined,
},
{
form: 'bar',
formDefinition: 'bar',
name: 'name4',
key: 'key4',
source: VARIABLE_SOURCES.userDefined,
},
],
},
Expand Down

0 comments on commit fa5166f

Please sign in to comment.