-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathEntityModal.stories.tsx
More file actions
53 lines (48 loc) · 1.38 KB
/
EntityModal.stories.tsx
File metadata and controls
53 lines (48 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import type { Meta, StoryObj } from '@storybook/react-vite';
import React from 'react';
import { fn } from 'storybook/test';
import EntityModal from '../EntityModal';
import { setUnifiedConfig } from '../../../util/util';
import { getGlobalConfigMock } from '../../../mocks/globalConfigMock';
const meta = {
component: EntityModal,
title: 'EntityModal',
render: (props) => {
// TODO: introduce a stateless stories component to reflect thaat component logic itself
setUnifiedConfig(getGlobalConfigMock()); // eslint-disable-line no-use-before-define
return <EntityModal {...props} />;
},
parameters: {
a11y: {
element: '[data-test="modal"]',
},
},
} satisfies Meta<typeof EntityModal>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Base: Story = {
args: {
handleRequestClose: fn(),
returnFocus: fn(),
serviceName: 'account',
mode: 'create',
stanzaName: undefined,
formLabel: '',
page: 'configuration',
groupName: '',
open: true,
},
};
export const Inputs: Story = {
args: {
handleRequestClose: fn(),
returnFocus: fn(),
serviceName: 'demo_input',
mode: 'create',
stanzaName: undefined,
formLabel: '',
page: 'inputs',
groupName: '',
open: true,
},
};