Skip to content

Commit 437fd7f

Browse files
committed
Add test case for clicking confirm button
1 parent 869e0cb commit 437fd7f

File tree

3 files changed

+153
-79
lines changed

3 files changed

+153
-79
lines changed

packages/components/src/components/Select/Default.tsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/components/src/components/Select/Select.stories.tsx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { css, Flex } from '@devup-ui/react'
22
import { Meta, StoryObj } from '@storybook/react-vite'
3-
import { useState } from 'react'
3+
import { ComponentProps, useState } from 'react'
44

55
import {
66
Select,
@@ -9,7 +9,6 @@ import {
99
SelectOption,
1010
SelectTrigger,
1111
} from '.'
12-
import { Default as DefaultComponent } from './Default'
1312
import { IconArrow } from './IconArrow'
1413

1514
export type Story = StoryObj<typeof meta>
@@ -29,7 +28,6 @@ const meta: Meta<typeof Select> = {
2928

3029
export const DefaultStory: Story = {
3130
args: {
32-
type: 'default',
3331
colors: {},
3432
},
3533
render: (args) => <DefaultComponent {...args} />,
@@ -47,6 +45,46 @@ export const ControlledCheckboxStory: Story = {
4745

4846
export default meta
4947

48+
export function DefaultComponent({
49+
...props
50+
}: Omit<ComponentProps<typeof Select>, 'children'>) {
51+
return (
52+
<Select {...props}>
53+
<SelectTrigger>Select</SelectTrigger>
54+
<SelectContainer>
55+
<SelectOption disabled value="Option 1">
56+
Option 1
57+
</SelectOption>
58+
<SelectOption value="Option 2">Option 2</SelectOption>
59+
<SelectDivider />
60+
<SelectOption value="Option 3">Option 3</SelectOption>
61+
<SelectOption disabled value="Option 4">
62+
Option 4
63+
</SelectOption>
64+
<Select type="radio">
65+
<SelectTrigger asChild>
66+
<SelectOption>
67+
<Flex alignItems="center" justifyContent="space-between" w="100%">
68+
Option 5<IconArrow />
69+
</Flex>
70+
</SelectOption>
71+
</SelectTrigger>
72+
<SelectContainer
73+
className={css({
74+
right: '0',
75+
top: '0',
76+
transform: 'translateX(100%)',
77+
})}
78+
>
79+
<SelectOption value="Option 6">Option 6</SelectOption>
80+
<SelectOption value="Option 7">Option 7</SelectOption>
81+
</SelectContainer>
82+
</Select>
83+
</SelectContainer>
84+
</Select>
85+
)
86+
}
87+
5088
function ControlledCheckbox() {
5189
const [value, setValue] = useState<string[]>([])
5290
const handleChange = (nextValue: string) => {

0 commit comments

Comments
 (0)