Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdjere committed Dec 28, 2022
1 parent ddc8921 commit 0eaf302
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x-pack/plugins/alerting/server/lib/last_run_status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('lastRunFromState', () => {
);

expect(result.lastRun.outcome).toEqual('warning');
expect(result.lastRun.outcomeMsg).toEqual(['Rule execution reported a warning']);
expect(result.lastRun.outcomeMsg).toEqual(['MOCK_WARNING', 'Rule execution reported a warning']);
expect(result.lastRun.warning).toEqual(null);

expect(result.lastRun.alertsCount).toEqual({
Expand Down Expand Up @@ -136,12 +136,13 @@ describe('lastRunFromState', () => {
},
getRuleResultService({
warnings: ['MOCK_WARNING'],
outcomeMessage: 'Rule execution reported a warning',
outcomeMessage: ruleExecutionOutcomeMessage,
})
);

expect(result.lastRun.outcome).toEqual('warning');
expect(result.lastRun.outcomeMsg).toEqual([
'MOCK_WARNING',
frameworkOutcomeMessage,
ruleExecutionOutcomeMessage,
]);
Expand Down Expand Up @@ -171,6 +172,7 @@ describe('lastRunFromState', () => {

expect(result.lastRun.outcome).toEqual('warning');
expect(result.lastRun.outcomeMsg).toEqual([
'MOCK_WARNING',
frameworkOutcomeMessage,
ruleExecutionOutcomeMessage,
]);
Expand All @@ -197,6 +199,7 @@ describe('lastRunFromState', () => {

expect(result.lastRun.outcome).toEqual('failed');
expect(result.lastRun.outcomeMsg).toEqual([
'MOCK_ERROR',
'Rule reported more than the maximum number of alerts in a single run. Alerts may be missed and recovery notifications may be delayed',
'Rule execution reported an error',
]);
Expand Down

0 comments on commit 0eaf302

Please sign in to comment.