-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
In #92898 the `alerts` plugin was renamed to `alerting`. We were checking if this plugin is enabled with a check like `'alerts' in plugins`, which is not type checked. Change the check to use `!!plugins.alerting` so this type of change will be caught in the future. Rename `get_alert_capabilities` to `get_alerting_capabilities` to match the name of the exported function. Add a test for it. Co-authored-by: Nathan L Smith <[email protected]>
- Loading branch information
1 parent
a0b8ea6
commit 76e9bc3
Showing
3 changed files
with
25 additions
and
2 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
23 changes: 23 additions & 0 deletions
23
x-pack/plugins/apm/public/components/alerting/get_alerting_capabilities.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,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { Capabilities } from 'kibana/public'; | ||
import { ApmPluginSetupDeps } from '../../plugin'; | ||
import { getAlertingCapabilities } from './get_alerting_capabilities'; | ||
|
||
describe('getAlertingCapabilities', () => { | ||
describe('when the alerting plugin is not enabled', () => { | ||
it('returns isAlertingAvailable = false', () => { | ||
expect( | ||
getAlertingCapabilities( | ||
{} as ApmPluginSetupDeps, | ||
({ apm: {} } as unknown) as Capabilities | ||
).isAlertingAvailable | ||
).toEqual(false); | ||
}); | ||
}); | ||
}); |
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