Skip to content

Commit

Permalink
updates tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Aug 25, 2021
1 parent 98b252b commit 104ac8f
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ describe('useAddOrUpdateException', () => {
let addExceptionListItem: jest.SpyInstance<Promise<ExceptionListItemSchema>>;
let updateExceptionListItem: jest.SpyInstance<Promise<ExceptionListItemSchema>>;
let getQueryFilter: jest.SpyInstance<ReturnType<typeof getQueryFilterHelper.getQueryFilter>>;
let buildAlertStatusFilter: jest.SpyInstance<
ReturnType<typeof buildFilterHelpers.buildAlertStatusFilter>
let buildAlertStatusesFilter: jest.SpyInstance<
ReturnType<typeof buildFilterHelpers.buildAlertStatusesFilter>
>;
let buildAlertsRuleIdFilter: jest.SpyInstance<
ReturnType<typeof buildFilterHelpers.buildAlertsRuleIdFilter>
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('useAddOrUpdateException', () => {

getQueryFilter = jest.spyOn(getQueryFilterHelper, 'getQueryFilter');

buildAlertStatusFilter = jest.spyOn(buildFilterHelpers, 'buildAlertStatusFilter');
buildAlertStatusesFilter = jest.spyOn(buildFilterHelpers, 'buildAlertStatusesFilter');

buildAlertsRuleIdFilter = jest.spyOn(buildFilterHelpers, 'buildAlertsRuleIdFilter');

Expand Down Expand Up @@ -328,8 +328,12 @@ describe('useAddOrUpdateException', () => {
addOrUpdateItems(...addOrUpdateItemsArgs);
}
await waitForNextUpdate();
expect(buildAlertStatusFilter).toHaveBeenCalledTimes(1);
expect(buildAlertStatusFilter.mock.calls[0][0]).toEqual('open');
expect(buildAlertStatusesFilter).toHaveBeenCalledTimes(1);
expect(buildAlertStatusesFilter.mock.calls[0][0]).toEqual([
'open',
'acknowledged',
'in-progress',
]);
});
});
it('should update the status of only alerts generated by the provided rule', async () => {
Expand Down

0 comments on commit 104ac8f

Please sign in to comment.