Skip to content

Commit

Permalink
fix test 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Quanmuito committed Jan 25, 2024
1 parent 02dc5b1 commit 4cd2946
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { render, screen, act } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import App from '../App';

Expand Down Expand Up @@ -28,7 +28,7 @@ describe('Test cart value input', () => {
expect(cartValueInput).toBeInTheDocument();

userEvent.type(cartValueInput, input);
act(() => userEvent.keyboard('{Enter}'));
userEvent.keyboard('{Enter}');
expect(cartValueInput).toHaveValue(expected);
}
);
Expand All @@ -44,7 +44,7 @@ describe('Test cart value input', () => {
expect(cartValueInput).toBeInTheDocument();

userEvent.type(cartValueInput, input);
act(() => userEvent.keyboard('{Enter}'));
userEvent.keyboard('{Enter}');
const error = await screen.findByText(pattern);
expect(error).toBeInTheDocument();
}
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('Test user event on delivery distance input', () => {
expect(deliveryDistanceInput).toBeInTheDocument();

userEvent.type(deliveryDistanceInput, input);
act(() => userEvent.keyboard('{Enter}'));
userEvent.keyboard('{Enter}');
const error = await screen.findByText(pattern);
expect(error).toBeInTheDocument();
}
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('Test user event on number of items input', () => {
expect(numberOfItemsInput).toBeInTheDocument();

userEvent.type(numberOfItemsInput, input);
act(() => userEvent.keyboard('{Enter}'));
userEvent.keyboard('{Enter}');
const error = await screen.findByText(pattern);
expect(error).toBeInTheDocument();
}
Expand Down

0 comments on commit 4cd2946

Please sign in to comment.