Skip to content

Commit

Permalink
Merge pull request #139 from pushkar1995/missionsTesting
Browse files Browse the repository at this point in the history
testing added for missions
  • Loading branch information
BilalLiaquat7 authored Sep 9, 2023
2 parents 21d9b84 + 2f2137b commit cbb8680
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/tests/Missions.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import { render } from '@testing-library/react';
import { useSelector } from 'react-redux';
import Missions from '../pages/Missions/Missions';

jest.mock('react-redux');

jest.mock('axios', () => ({
get: jest.fn(),
}));

test('Rockets component renders correctly', () => {
useSelector.mockReturnValue({
missions: [
{
id: 1,
mission_name: 'Thaicom',
description: 'A powerful rocket developed by SpaceX.',
reserved: false,
},
],
});

const { container } = render(<Missions />);

expect(container).toMatchSnapshot();
});

0 comments on commit cbb8680

Please sign in to comment.