Update test case for sortBy, select, orderBy component

This commit is contained in:
2023-11-28 17:49:22 +07:00
parent ddf96492c9
commit 7bb83f74c8
20 changed files with 1412 additions and 413 deletions
@@ -0,0 +1,40 @@
import { render, act } from '@testing-library/react';
import * as userServices from '@service/userServices';
import * as roomServices from '@service/roomServices';
import App from '../../App';
jest.mock('@service/userServices');
jest.mock('@service/roomServices');
describe('App', () => {
test('Should init room, user data', async () => {
const mockGetUserNotBooked = jest.spyOn(userServices, 'getUserNotBooked');
const mockGetRoomAvailable = jest.spyOn(roomServices, 'getRoomsAvailable');
mockGetUserNotBooked.mockResolvedValue([
{
id: 1,
name: 'Nezumi',
},
{
id: 2,
name: 'Loi Phan',
},
]);
mockGetRoomAvailable.mockResolvedValue([
{
id: 1,
name: 'Room 1',
},
{
id: 2,
name: 'Room 2',
},
]);
await act(async () => {
render(<App />);
});
});
});