Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Oct 11, 2022
1 parent 80a170a commit 5dc44a8
Showing 1 changed file with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,55 @@ describe('rule_event_log_list_kpi', () => {
/>
);

expect(wrapper.find('[data-test-subj="centerJustifiedSpinner"]').exists()).toBeTruthy();
expect(
wrapper
.find('[data-test-subj="ruleEventLogKpi-successOutcome"] .euiStat__title')
.first()
.text()
).toEqual('--');
expect(
wrapper
.find('[data-test-subj="ruleEventLogKpi-unknownOutcome"] .euiStat__title')
.first()
.text()
).toEqual('--');
expect(
wrapper
.find('[data-test-subj="ruleEventLogKpi-failureOutcome"] .euiStat__title')
.first()
.text()
).toEqual('--');
expect(
wrapper.find('[data-test-subj="ruleEventLogKpi-activeAlerts"] .euiStat__title').first().text()
).toEqual('--');
expect(
wrapper.find('[data-test-subj="ruleEventLogKpi-newAlerts"] .euiStat__title').first().text()
).toEqual('--');
expect(
wrapper
.find('[data-test-subj="ruleEventLogKpi-recoveredAlerts"] .euiStat__title')
.first()
.text()
).toEqual('--');
expect(
wrapper
.find('[data-test-subj="ruleEventLogKpi-erroredActions"] .euiStat__title')
.first()
.text()
).toEqual('--');
expect(
wrapper
.find('[data-test-subj="ruleEventLogKpi-triggeredActions"] .euiStat__title')
.first()
.text()
).toEqual('--');

// Let the load resolve
await act(async () => {
await nextTick();
wrapper.update();
});

expect(wrapper.find('[data-test-subj="centerJustifiedSpinner"]').exists()).toBeFalsy();

expect(loadExecutionKPIAggregationsMock).toHaveBeenCalledWith(
expect.objectContaining({
id: '123',
Expand Down

0 comments on commit 5dc44a8

Please sign in to comment.