Skip to content

Commit af32dc2

Browse files
committed
chore: update select with combobox storybook
1 parent f8dc674 commit af32dc2

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

src/app/components/SelectWithCombobox/SelectWithCombobox.stories.tsx

+1-16
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const meta = {
1717

1818
export default meta;
1919

20-
export const MultipleOptions = () => {
20+
export const SelectWithComboboxStory = () => {
2121
const [selectedValue, setSelectedValue] = useState<string | null>(null);
2222

2323
return (
@@ -58,18 +58,3 @@ export const MultipleOptions = () => {
5858
</OverlayProvider>
5959
);
6060
};
61-
62-
export const EmptyOption = () => {
63-
const [selectedValue, setSelectedValue] = useState<string | null>(null);
64-
return (
65-
<SelectWithCombobox
66-
label='사용자'
67-
emptyValue={<div>설정하기</div>}
68-
emptyList={<span>No Results</span>}
69-
placeholder='이름을 입력해주세요.'
70-
optionList={[]}
71-
selectedValue={selectedValue}
72-
onChange={setSelectedValue}
73-
/>
74-
);
75-
};

src/app/components/SelectWithCombobox/SelectWithCombobox.test.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { render } from 'vitest-browser-react';
33

44
import { getA11ySnapshot } from '@/test/getA11ySnapshot';
55

6-
import { MultipleOptions } from './SelectWithCombobox.stories';
6+
import { SelectWithComboboxStory } from './SelectWithCombobox.stories';
77

8-
describe('SelectWithCombobox', () => {
8+
describe('SelectWithCombobox test', () => {
99
it('콤보박스를 클릭하면 옵션 목록을 보여준다.', async () => {
10-
const screen = render(<MultipleOptions />);
10+
const screen = render(<SelectWithComboboxStory />);
1111

1212
// given 콤보박스의 초기 상태에서 "설정하기" 텍스트가 표시된다.
1313
await expect
@@ -37,7 +37,7 @@ describe('SelectWithCombobox', () => {
3737
});
3838

3939
it('옵션을 검색할 수 있다.', async () => {
40-
const screen = render(<MultipleOptions />);
40+
const screen = render(<SelectWithComboboxStory />);
4141
await screen.getByRole('combobox', { name: '사용자' }).click();
4242

4343
await screen
@@ -61,7 +61,7 @@ describe('SelectWithCombobox', () => {
6161
});
6262

6363
it('검색 결과가 없는 경우 "No Result" 메시지를 보여준다.', async () => {
64-
const screen = render(<MultipleOptions />);
64+
const screen = render(<SelectWithComboboxStory />);
6565

6666
await screen.getByRole('combobox', { name: '사용자' }).click();
6767
await screen
@@ -74,7 +74,7 @@ describe('SelectWithCombobox', () => {
7474
});
7575

7676
it('옵션을 선택하고 해재할 수 있다.', async () => {
77-
const screen = render(<MultipleOptions />);
77+
const screen = render(<SelectWithComboboxStory />);
7878

7979
await screen.getByRole('combobox', { name: '사용자' }).click();
8080
await screen.getByRole('option', { name: '김태희' }).click();

0 commit comments

Comments
 (0)