From 50892f21892d604352034c2e8b405cb4cbe8e33e Mon Sep 17 00:00:00 2001 From: Edoardo Sabadelli Date: Fri, 13 Dec 2024 16:42:33 +0100 Subject: [PATCH] test: add stories for DataDimension component --- src/__demo__/DataDimension.stories.js | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/__demo__/DataDimension.stories.js diff --git a/src/__demo__/DataDimension.stories.js b/src/__demo__/DataDimension.stories.js new file mode 100644 index 000000000..8e1062624 --- /dev/null +++ b/src/__demo__/DataDimension.stories.js @@ -0,0 +1,53 @@ +import { DataProvider } from '@dhis2/app-runtime' +import { ConfigProvider } from '@dhis2/app-service-config' +import React, { useState } from 'react' +import DataDimension from '../components/DataDimension/DataDimension.js' + +const Wrapper = (story) => ( + + + {story()} + + +) + +export default { + title: 'DataDimension', + decorators: [Wrapper], +} + +export const NoneSelected = () => { + const [selected, setSelected] = useState([]) + + return ( + setSelected(response.items)} + /> + ) +} + +NoneSelected.story = { + name: 'None selected', +} + +export const WithInfoBoxMessage = () => { + const [selected, setSelected] = useState([]) + + return ( + setSelected(response.items)} + infoBoxMessage={'Test message showing in the info box'} + /> + ) +} + +WithInfoBoxMessage.story = { + name: 'With info box message', +}