Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
StormyFrolic committed Jul 7, 2023
1 parent 984ad56 commit 9b1c774
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/ActiveProduct/ActiveProduct.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ test('renders selected product card', () => {
</Provider>
);

const cardElement = screen.getByText(/See all the things/i);
const cardElement = screen.getByText(/TV/i);
const relatedElement = screen.getByText(/Related Items/i);
expect(cardElement).toBeInTheDocument();
expect(relatedElement).toBeInTheDocument();
});
4 changes: 2 additions & 2 deletions src/components/Cart/cart.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Cart from '.';

import { Provider } from 'react-redux';
import store from '../../redux/store';
test('renders Header links', () => {
test('renders cart', () => {
render(
<Provider store={store}>
<Cart />
</Provider>
);

const cartElement = screen.getByText(/Cart/i);
const cartElement = screen.getByTestId('CART');
expect(cartElement).toBeInTheDocument();
});
1 change: 1 addition & 0 deletions src/components/Cart/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default function Cart() {

return (
<Box
data-testid='CART'
position='fixed'
color='primary'
sx={{
Expand Down
2 changes: 1 addition & 1 deletion src/components/Products/Products.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Provider } from 'react-redux';
test('renders product card', () => {
render(
<Provider store={store}>
<Products chosenCategory={0} />
<Products />
</Provider>
);

Expand Down

0 comments on commit 9b1c774

Please sign in to comment.