Skip to content

Commit

Permalink
fix: 스토리북 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
xodms0309 committed Jun 8, 2023
1 parent 15a9cd9 commit 4fa7596
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/Cart/CartItemList/CartItemList.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { Meta, StoryObj } from '@storybook/react';
import CartItemList from '.';
import data from '../../../mocks/cartList.json';

const cartItemList = {
component: CartItemList,
title: 'Cart/CartItemList',
tags: ['autodocs'],
args: {
cartList: data,
},
} satisfies Meta<typeof CartItemList>;

export default cartItemList;
Expand Down
1 change: 1 addition & 0 deletions src/components/Order/OrderItem/OrderItem.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const mock = {
name: '깜짝 놀란 춘식이',
imageUrl:
'https://pbs.twimg.com/profile_images/1641252178450083841/Cn2MUfHG_400x400.jpg',
price: 10000,
totalPrice: 30000,
totalDiscountPrice: 10000,
};
Expand Down
26 changes: 26 additions & 0 deletions src/mocks/cartList.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"id": 1,
"quantity": 5,
"product": {
"id": 1,
"price": 10000,
"name": "오히려 좋은 춘식이",
"imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73ff604e7b0e6900f9ac53a43965300eb9a",
"isOnSale": true,
"salePrice": 4000
}
},
{
"id": 2,
"quantity": 3,
"product": {
"id": 3,
"price": 30000,
"name": "힝 춘식이",
"imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73f15b3f4e3c2033bfd702a321ec6eda72c",
"isOnSale": false,
"salePrice": 0
}
}
]
3 changes: 3 additions & 0 deletions src/mocks/orderList.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"id": 1,
"name": "오히려 좋은 춘식이",
"imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73ff604e7b0e6900f9ac53a43965300eb9a",
"price": 10000,
"totalPrice": 7000,
"totalDiscountPrice": 1000,
"quantity": 3
Expand All @@ -15,6 +16,7 @@
"id": 2,
"name": "힝 춘식이",
"imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73f15b3f4e3c2033bfd702a321ec6eda72c",
"price": 10000,
"totalPrice": 7000,
"totalDiscountPrice": 1000,
"quantity": 3
Expand All @@ -29,6 +31,7 @@
"id": 1,
"name": "오히려 좋은 춘식이",
"imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73ff604e7b0e6900f9ac53a43965300eb9a",
"price": 10000,
"totalPrice": 7000,
"totalDiscountPrice": 1000,
"quantity": 3
Expand Down

0 comments on commit 4fa7596

Please sign in to comment.