[4팀 최하늘] [Chapter 2-2] 디자인 패턴과 함수형 프로그래밍 #13
Annotations
14 errors and 2 warnings
src/basic/__tests__/basic.test.tsx > basic > > 시나리오 테스트 > > 장바구니 페이지 테스트 > :
src/basic/__tests__/basic.test.tsx#L116
TestingLibraryElementError: Unable to find an element with the text: 상품 금액: 10,000원. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div>
<div
class="container mx-auto p-4"
>
<h1
class="text-3xl font-bold mb-6"
>
장바구니
</h1>
<div
class="grid grid-cols-1 md:grid-cols-2 gap-6"
>
<div>
<h2
class="text-2xl font-semibold mb-4"
>
상품 목록
</h2>
<div
class="space-y-2"
>
<div
class="bg-white p-3 rounded shadow"
data-testid="product-p1"
>
<div
class="flex justify-between items-center mb-2"
>
<span
class="font-semibold"
>
상품1
</span>
<span
class="text-gray-600"
>
10,000
원
</span>
</div>
<div
class="text-sm text-gray-500 mb-2"
>
<span
class="font-medium text-green-600"
>
재고:
20
개
</span>
<span
class="ml-2 font-medium text-blue-600"
>
최대
10
% 할인
</span>
</div>
<ul
class="list-disc list-inside text-sm text-gray-500 mb-2"
>
<li>
10
개 이상:
10
% 할인
</li>
</ul>
<button
class="w-full px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600"
>
장바구니에 추가
</button>
</div>
<div
class="bg-white p-3 rounded shadow"
data-testid="product-p2"
>
<div
class="flex justify-between items-center mb-2"
>
<span
class="font-semibold"
>
상품2
</span>
<span
class="text-gray-600"
>
20,000
원
</span>
</div>
<div
class="text-sm text-gray-500 mb-2"
>
<span
class="font-medium text-green-600"
>
재고:
20
개
</span>
<span
class="ml-2 font-medium text-blue-600"
>
최대
15
% 할인
</span>
</div>
<ul
class="list-disc list-inside text-sm text-gray-500 mb-2"
>
<li>
10
개 이상:
15
% 할인
</li>
</ul>
<button
class="w-full px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600"
>
장바구니에 추가
</button>
</div>
<div
class="bg-white p-3 rounded shadow"
data-testid="product-p3"
>
<div
class="flex justify-between items-center mb-2"
>
<span
class="font-semibold"
>
상품3
</span>
<span
class="text-gray-600"
>
30,000
원
</span>
</div>
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > calculateItemTotal > 할인 없이 총액을 계산해야 합니다.:
src/basic/__tests__/basic.test.tsx#L358
AssertionError: expected +0 to be 100 // Object.is equality
- Expected
+ Received
- 100
+ 0
❯ src/basic/__tests__/basic.test.tsx:358:52
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > calculateItemTotal > 수량에 따라 올바른 할인을 적용해야 합니다.:
src/basic/__tests__/basic.test.tsx#L363
AssertionError: expected +0 to be 400 // Object.is equality
- Expected
+ Received
- 400
+ 0
❯ src/basic/__tests__/basic.test.tsx:363:52
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > getMaxApplicableDiscount > 적용 가능한 가장 높은 할인율을 반환해야 합니다.:
src/basic/__tests__/basic.test.tsx#L375
AssertionError: expected +0 to be 0.2 // Object.is equality
- Expected
+ Received
- 0.2
+ 0
❯ src/basic/__tests__/basic.test.tsx:375:58
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > calculateCartTotal > 쿠폰 없이 총액을 올바르게 계산해야 합니다.:
src/basic/__tests__/basic.test.tsx#L387
AssertionError: expected +0 to be 400 // Object.is equality
- Expected
+ Received
- 400
+ 0
❯ src/basic/__tests__/basic.test.tsx:387:44
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > calculateCartTotal > 금액쿠폰을 올바르게 적용해야 합니다.:
src/basic/__tests__/basic.test.tsx#L400
AssertionError: expected +0 to be 330 // Object.is equality
- Expected
+ Received
- 330
+ 0
❯ src/basic/__tests__/basic.test.tsx:400:43
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > calculateCartTotal > 퍼센트 쿠폰을 올바르게 적용해야 합니다:
src/basic/__tests__/basic.test.tsx#L412
AssertionError: expected +0 to be 342 // Object.is equality
- Expected
+ Received
- 342
+ 0
❯ src/basic/__tests__/basic.test.tsx:412:43
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > updateCartItemQuantity > 수량을 올바르게 업데이트해야 합니다:
src/basic/__tests__/basic.test.tsx#L425
TypeError: Cannot read properties of undefined (reading 'quantity')
❯ src/basic/__tests__/basic.test.tsx:425:31
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > updateCartItemQuantity > 수량이 0으로 설정된 경우 항목을 제거해야 합니다.:
src/basic/__tests__/basic.test.tsx#L431
AssertionError: expected +0 to be 1 // Object.is equality
- Expected
+ Received
- 1
+ 0
❯ src/basic/__tests__/basic.test.tsx:431:36
|
src/basic/__tests__/basic.test.tsx > basic > > cartUtils > updateCartItemQuantity > 재고 한도를 초과해서는 안 됩니다.:
src/basic/__tests__/basic.test.tsx#L437
TypeError: Cannot read properties of undefined (reading 'quantity')
❯ src/basic/__tests__/basic.test.tsx:437:31
|
src/advanced/__tests__/advanced.test.tsx > advanced > > 시나리오 테스트 > > 장바구니 페이지 테스트 > :
src/advanced/__tests__/advanced.test.tsx#L109
TestingLibraryElementError: Unable to find an element with the text: 상품 금액: 10,000원. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div>
<div
class="container mx-auto p-4"
>
<h1
class="text-3xl font-bold mb-6"
>
장바구니
</h1>
<div
class="grid grid-cols-1 md:grid-cols-2 gap-6"
>
<div>
<h2
class="text-2xl font-semibold mb-4"
>
상품 목록
</h2>
<div
class="space-y-2"
>
<div
class="bg-white p-3 rounded shadow"
data-testid="product-p1"
>
<div
class="flex justify-between items-center mb-2"
>
<span
class="font-semibold"
>
상품1
</span>
<span
class="text-gray-600"
>
10,000
원
</span>
</div>
<div
class="text-sm text-gray-500 mb-2"
>
<span
class="font-medium text-green-600"
>
재고:
20
개
</span>
<span
class="ml-2 font-medium text-blue-600"
>
최대
10
% 할인
</span>
</div>
<ul
class="list-disc list-inside text-sm text-gray-500 mb-2"
>
<li>
10
개 이상:
10
% 할인
</li>
</ul>
<button
class="w-full px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600"
>
장바구니에 추가
</button>
</div>
<div
class="bg-white p-3 rounded shadow"
data-testid="product-p2"
>
<div
class="flex justify-between items-center mb-2"
>
<span
class="font-semibold"
>
상품2
</span>
<span
class="text-gray-600"
>
20,000
원
</span>
</div>
<div
class="text-sm text-gray-500 mb-2"
>
<span
class="font-medium text-green-600"
>
재고:
20
개
</span>
<span
class="ml-2 font-medium text-blue-600"
>
최대
15
% 할인
</span>
</div>
<ul
class="list-disc list-inside text-sm text-gray-500 mb-2"
>
<li>
10
개 이상:
15
% 할인
</li>
</ul>
<button
class="w-full px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600"
>
장바구니에 추가
</button>
</div>
<div
class="bg-white p-3 rounded shadow"
data-testid="product-p3"
>
<div
class="flex justify-between items-center mb-2"
>
<span
class="font-semibold"
>
상품3
</span>
<span
class="text-gray-600"
>
30,000
원
</span>
</div>
|
src/advanced/__tests__/advanced.test.tsx > advanced > > 자유롭게 작성해보세요. > 새로운 유틸 함수를 만든 후에 테스트 코드를 작성해서 실행해보세요:
src/advanced/__tests__/advanced.test.tsx#L236
AssertionError: expected true to be false // Object.is equality
- Expected
+ Received
- false
+ true
❯ src/advanced/__tests__/advanced.test.tsx:236:20
|
src/advanced/__tests__/advanced.test.tsx > advanced > > 자유롭게 작성해보세요. > 새로운 hook 함수르 만든 후에 테스트 코드를 작성해서 실행해보세요:
src/advanced/__tests__/advanced.test.tsx#L240
AssertionError: expected true to be false // Object.is equality
- Expected
+ Received
- false
+ true
❯ src/advanced/__tests__/advanced.test.tsx:240:20
|
advacned
Process completed with exit code 1.
|
basic
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
advacned
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|