Skip to content

Commit

Permalink
Remove cancelled test
Browse files Browse the repository at this point in the history
  • Loading branch information
Heenawter committed Oct 17, 2023
1 parent 4d4547d commit c23d21c
Showing 1 changed file with 2 additions and 36 deletions.
Expand Up @@ -104,12 +104,12 @@ describe('Unsaved listing', () => {
{
id: 'failCase1',
status: 'error',
error: { error: 'oh no', message: 'bwah', statusCode: 100 },
error: { error: 'oh no', message: 'bwah', statusCode: 404 },
},
{
id: 'failCase2',
status: 'error',
error: { error: 'oh no', message: 'bwah', statusCode: 100 },
error: { error: 'oh no', message: 'bwah', statusCode: 404 },
},
]);

Expand Down Expand Up @@ -138,38 +138,4 @@ describe('Unsaved listing', () => {
).toHaveBeenCalledTimes(2);
});
});

it('does not remove unsaved changes when fetch is cancelled', async () => {
(
pluginServices.getServices().dashboardContentManagement.findDashboards.findByIds as jest.Mock
).mockResolvedValue([
{
id: 'cancelledId',
status: 'cancelled',
},
{
id: 'failedId',
status: 'error',
error: { error: 'oh no', message: 'bwah', statusCode: 100 },
},
]);

const props = makeDefaultProps();

props.unsavedDashboardIds = [
'dashboardUnsavedOne',
'dashboardUnsavedTwo',
'dashboardUnsavedThree',
'cancelledId',
'failedId',
];
const { component } = mountWith({ props });
waitFor(() => {
component.update();
expect(pluginServices.getServices().dashboardBackup.clearState).not.toBeCalledWith(
'cancelledId'
);
expect(pluginServices.getServices().dashboardBackup.clearState).toBeCalledWith('failedId');
});
});
});

0 comments on commit c23d21c

Please sign in to comment.