Skip to content

Commit

Permalink
test: (#123) 프롭스 수정에 따른 테스트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chsua committed Jul 25, 2023
1 parent 7ad3c6a commit 540f6c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 35 deletions.
26 changes: 2 additions & 24 deletions frontend/src/components/common/Layout/Layout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';

import type { User } from '@type/user';

import { MOCK_FAVORITE_CATEGORIES } from '@mocks/mockData/category';

import Skeleton from '../Skeleton';

import Layout from '.';
Expand All @@ -15,22 +11,9 @@ const meta: Meta<typeof Layout> = {
export default meta;
type Story = StoryObj<typeof Layout>;

const MOCK_USER_INFO: User = {
nickname: '우아한 코끼리',
postCount: 4,
voteCount: 128,
userPoint: 200,
};

export const VisibleCategory: Story = {
render: () => (
<Layout
isSidebarVisible={true}
userInfo={MOCK_USER_INFO}
categoryList={MOCK_FAVORITE_CATEGORIES}
handleFavoriteClick={() => {}}
handleLogoutClick={() => {}}
>
<Layout isSidebarVisible={true}>
<Skeleton />
<Skeleton />
<Skeleton />
Expand All @@ -47,12 +30,7 @@ export const VisibleCategory: Story = {

export const HiddenCategory: Story = {
render: () => (
<Layout
isSidebarVisible={false}
categoryList={MOCK_FAVORITE_CATEGORIES}
handleFavoriteClick={() => {}}
handleLogoutClick={() => {}}
>
<Layout isSidebarVisible={false}>
<Skeleton />
<Skeleton />
<Skeleton />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';

import { MOCK_FAVORITE_CATEGORIES } from '@mocks/mockData/category';
import { MOCK_USER_INFO } from '@mocks/mockData/user';

import PostListPage from '.';

const meta: Meta<typeof PostListPage> = {
Expand All @@ -13,12 +10,5 @@ export default meta;
type Story = StoryObj<typeof PostListPage>;

export const Default: Story = {
render: () => (
<PostListPage
userInfo={MOCK_USER_INFO}
categoryList={MOCK_FAVORITE_CATEGORIES}
handleFavoriteClick={() => {}}
handleLogoutClick={() => {}}
/>
),
render: () => <PostListPage />,
};

0 comments on commit 540f6c6

Please sign in to comment.