Skip to content

Commit

Permalink
[PPANTT-42] fix: Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svariant committed Aug 2, 2024
1 parent 173238c commit 06340d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('<CommissionBundleDetailPage /> for PSP', () => {
test('render component CommissionBundleDetailPage bundle type PRIVATE', async () => {
deleteMock.mockReturnValueOnce(new Promise((resolve) => resolve()));
let bundle = { ...mockedCommissionBundlePspDetailPrivate };
bundle.validityDateFrom = new Date();
bundle.validityDateFrom = new Date("01/01/2020");
render(
<Provider store={store}>
<ComponentToRender bundle={bundle} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,21 @@ import { render } from '@testing-library/react';
import React from 'react';
import { Provider } from 'react-redux';
import StationMaintenancesHoursSummary from '../StationMaintenancesHoursSummary';
import * as StationMaintenanceService from '../../../../services/stationMaintenancesService';
import { mockMaintenanceHoursSummary } from '../../../../services/__mocks__/stationMaintenancesService';
import { store } from '../../../../redux/store';

const mockGetStationMaintenances = jest.spyOn(
StationMaintenanceService,
'getBrokerMaintenancesSummary'
);
describe('<StationMaintenancesHoursSummary />', () => {
test('render StationMaintenancesHoursSummary', () => {
mockGetStationMaintenances.mockResolvedValueOnce(mockMaintenanceHoursSummary);
render(
<Provider store={store}>
<StationMaintenancesHoursSummary />
<StationMaintenancesHoursSummary hoursSummary={mockMaintenanceHoursSummary}/>
</Provider>
);
});
test('render StationMaintenancesHoursSummary error getBrokerMaintenancesSummary', () => {
mockGetStationMaintenances.mockRejectedValueOnce("error");
render(
<Provider store={store}>
<StationMaintenancesHoursSummary />
<StationMaintenancesHoursSummary hoursSummary={mockMaintenanceHoursSummary}/>
</Provider>
);
});
Expand Down

0 comments on commit 06340d9

Please sign in to comment.