diff --git a/src/components/presentational/ProductDetail.test.jsx b/src/components/presentational/ProductDetail.test.jsx index ae05076..9d0790d 100644 --- a/src/components/presentational/ProductDetail.test.jsx +++ b/src/components/presentational/ProductDetail.test.jsx @@ -5,7 +5,6 @@ import { render, fireEvent } from '@testing-library/react'; import ProductDetail from './ProductDetail'; import products from '../../../fixtures/products'; -import product from '../../../fixtures/product'; describe('ProductDetail', () => { function renderProductDetail({ product }) { @@ -17,10 +16,11 @@ describe('ProductDetail', () => { } it('renders product detail', () => { - const { container } = renderProductDetail({ product }); + const { title, region } = products[0]; + const { container } = renderProductDetail({ product: products[0] }); - expect(container).toHaveTextContent(product.title); - expect(container).toHaveTextContent(product.region); + expect(container).toHaveTextContent(title); + expect(container).toHaveTextContent(region); }); context('without product images', () => { diff --git a/src/services/api.test.js b/src/services/api.test.js index 970419e..6de8c5c 100644 --- a/src/services/api.test.js +++ b/src/services/api.test.js @@ -74,7 +74,7 @@ describe('api', () => { const data = await uploadProductImages({ files }); - const productImages = files.map((file, _) => ({ + const productImages = files.map((file) => ({ name: file.name, imageUrl: 'MOCK_IMAGE_URL', }));