-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stories for QuestionQuantity widget
Refs: #323
- Loading branch information
1 parent
23b63a7
commit fe04b48
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
src/components/BaseQuestionnaireResponseForm/widgets/QuestionQuantity.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { ItemContext } from 'sdc-qrf/lib/types'; | ||
|
||
import { WithQuestionFormProviderDecorator, withColorSchemeDecorator } from 'src/storybook/decorators'; | ||
|
||
import { QuestionQuantity } from './index'; | ||
|
||
const meta: Meta<typeof QuestionQuantity> = { | ||
title: 'Questionnaire / questions / quantity', | ||
component: QuestionQuantity, | ||
decorators: [withColorSchemeDecorator, WithQuestionFormProviderDecorator], | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof QuestionQuantity>; | ||
|
||
export const Example: Story = { | ||
render: () => ( | ||
<QuestionQuantity | ||
parentPath={[]} | ||
questionItem={{ | ||
text: 'Example', | ||
type: 'quantity', | ||
linkId: 'example', | ||
required: true, | ||
unitOption: [ | ||
{ | ||
code: 'foot', | ||
system: 'http://unitsofmeasure.org', | ||
display: 'ft', | ||
}, | ||
{ | ||
code: 'inch', | ||
system: 'http://unitsofmeasure.org', | ||
display: 'in', | ||
}, | ||
{ | ||
code: 'cm', | ||
system: 'http://unitsofmeasure.org', | ||
display: 'cm', | ||
}, | ||
], | ||
}} | ||
context={{} as ItemContext} | ||
/> | ||
), | ||
}; | ||
|
||
export const Single: Story = { | ||
render: () => ( | ||
<QuestionQuantity | ||
parentPath={[]} | ||
questionItem={{ | ||
text: 'Example', | ||
type: 'quantity', | ||
linkId: 'example', | ||
required: true, | ||
unitOption: [ | ||
{ | ||
code: 'foot', | ||
system: 'http://unitsofmeasure.org', | ||
display: 'ft', | ||
}, | ||
], | ||
}} | ||
context={{} as ItemContext} | ||
/> | ||
), | ||
}; |