Skip to content

Commit

Permalink
fixed resolved in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Nov 26, 2020
1 parent 6dd664d commit 0d57716
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function listAlertTypes({ getService }: FtrProviderContext) {
const expectedNoOpType = {
actionGroups: [
{ id: 'default', name: 'Default' },
{ id: 'resolved', name: 'Resolved' },
{ id: 'recovered', name: 'Recovered' },
],
defaultActionGroupId: 'default',
id: 'test.noop',
Expand All @@ -33,7 +33,7 @@ export default function listAlertTypes({ getService }: FtrProviderContext) {
const expectedRestrictedNoOpType = {
actionGroups: [
{ id: 'default', name: 'Default' },
{ id: 'resolved', name: 'Resolved' },
{ id: 'recovered', name: 'Recovered' },
],
defaultActionGroupId: 'default',
id: 'test.restricted-noop',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ instanceStateValue: true
await taskManagerUtils.waitForActionTaskParamsToBeCleanedUp(testStart);
});

it('should fire actions when an alert instance is resolved', async () => {
it('should fire actions when an alert instance is recovered', async () => {
const reference = alertUtils.generateReference();

const { body: createdAction } = await supertestWithoutAuth
Expand Down Expand Up @@ -179,7 +179,7 @@ instanceStateValue: true
params: {
index: ES_TEST_INDEX_NAME,
reference,
message: 'Resolved message',
message: 'Recovered message',
},
},
],
Expand All @@ -194,10 +194,10 @@ instanceStateValue: true
await esTestIndexTool.waitForDocs('action:test.index-record', reference)
)[0];

expect(actionTestRecord._source.params.message).to.eql('Resolved message');
expect(actionTestRecord._source.params.message).to.eql('Recovered message');
});

it('should not fire actions when an alert instance is resolved, but alert is muted', async () => {
it('should not fire actions when an alert instance is recovered, but alert is muted', async () => {
const testStart = new Date();
const reference = alertUtils.generateReference();

Expand Down Expand Up @@ -242,7 +242,7 @@ instanceStateValue: true
params: {
index: ES_TEST_INDEX_NAME,
reference,
message: 'Resolved message',
message: 'Recovered message',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function eventLogTests({ getService }: FtrProviderContext) {
'execute-action',
'new-instance',
'active-instance',
'resolved-instance',
'recovered-instance',
],
});
});
Expand All @@ -86,7 +86,7 @@ export default function eventLogTests({ getService }: FtrProviderContext) {
const executeEvents = getEventsByAction(events, 'execute');
const executeActionEvents = getEventsByAction(events, 'execute-action');
const newInstanceEvents = getEventsByAction(events, 'new-instance');
const resolvedInstanceEvents = getEventsByAction(events, 'resolved-instance');
const resolvedInstanceEvents = getEventsByAction(events, 'recovered-instance');

expect(executeEvents.length >= 4).to.be(true);
expect(executeActionEvents.length).to.be(2);
Expand Down Expand Up @@ -135,8 +135,8 @@ export default function eventLogTests({ getService }: FtrProviderContext) {
case 'new-instance':
validateInstanceEvent(event, `created new instance: 'instance'`);
break;
case 'resolved-instance':
validateInstanceEvent(event, `resolved instance: 'instance'`);
case 'recovered-instance':
validateInstanceEvent(event, `recovered instance: 'instance'`);
break;
case 'active-instance':
validateInstanceEvent(event, `active instance: 'instance' in actionGroup: 'default'`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default function createGetAlertInstanceSummaryTests({ getService }: FtrPr

await alertUtils.muteInstance(createdAlert.id, 'instanceC');
await alertUtils.muteInstance(createdAlert.id, 'instanceD');
await waitForEvents(createdAlert.id, ['new-instance', 'resolved-instance']);
await waitForEvents(createdAlert.id, ['new-instance', 'recovered-instance']);
const response = await supertest.get(
`${getUrlPrefix(Spaces.space1.id)}/api/alerts/alert/${createdAlert.id}/_instance_summary`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function listAlertTypes({ getService }: FtrProviderContext) {
expect(fixtureAlertType).to.eql({
actionGroups: [
{ id: 'default', name: 'Default' },
{ id: 'resolved', name: 'Resolved' },
{ id: 'recovered', name: 'Recovered' },
],
defaultActionGroupId: 'default',
id: 'test.noop',
Expand Down

0 comments on commit 0d57716

Please sign in to comment.