diff --git a/src/tests/Missions.test.js b/src/tests/Missions.test.js new file mode 100644 index 0000000..4df9f4e --- /dev/null +++ b/src/tests/Missions.test.js @@ -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(); + + expect(container).toMatchSnapshot(); +});