-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [APM] Handle ML errors * Add capability check * Improve test * Address Caue’s feedback * Move getSeverity * Fix tsc * Fix copy
- Loading branch information
Showing
17 changed files
with
355 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
x-pack/plugins/apm/public/components/app/ServiceMap/Popover/getSeverity.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { getSeverity, severity } from './getSeverity'; | ||
|
||
describe('getSeverity', () => { | ||
describe('when score is undefined', () => { | ||
it('returns undefined', () => { | ||
expect(getSeverity(undefined)).toEqual(undefined); | ||
}); | ||
}); | ||
|
||
describe('when score < 25', () => { | ||
it('returns warning', () => { | ||
expect(getSeverity(10)).toEqual(severity.warning); | ||
}); | ||
}); | ||
|
||
describe('when score is between 25 and 50', () => { | ||
it('returns minor', () => { | ||
expect(getSeverity(40)).toEqual(severity.minor); | ||
}); | ||
}); | ||
|
||
describe('when score is between 50 and 75', () => { | ||
it('returns major', () => { | ||
expect(getSeverity(60)).toEqual(severity.major); | ||
}); | ||
}); | ||
|
||
describe('when score is 75 or more', () => { | ||
it('returns critical', () => { | ||
expect(getSeverity(100)).toEqual(severity.critical); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.