Skip to content

Commit 5ea008e

Browse files
committed
test: 공통 Tooltip 컴포넌트 스토리북 테스트코드 작성
1 parent 9bdd651 commit 5ea008e

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
2+
3+
import Tooltip from './Tooltip';
4+
5+
const meta: Meta<typeof Tooltip> = {
6+
title: 'Shared/UI/Tooltip',
7+
component: Tooltip,
8+
parameters: {
9+
layout: 'centered',
10+
},
11+
tags: ['autodocs'],
12+
argTypes: {
13+
message: { control: 'text' },
14+
visible: { control: 'boolean' },
15+
},
16+
};
17+
18+
export default meta;
19+
type Story = StoryObj<typeof Tooltip>;
20+
21+
export const Default: Story = {
22+
args: {
23+
message: '툴팁 내용이 들어갑니다',
24+
children: (
25+
<button className='rounded bg-gray-200 px-4 py-2'>
26+
마우스를 올려보세요
27+
</button>
28+
),
29+
},
30+
};
31+
32+
export const AlwaysVisible: Story = {
33+
args: {
34+
message: '항상 보이는 툴팁',
35+
children: <div className='h-10 w-10 rounded-full bg-blue-500' />,
36+
visible: true,
37+
},
38+
};

0 commit comments

Comments
 (0)