File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
x-pack/plugins/infra/public
alerting/metric_threshold/components
pages/metrics/inventory_view/hooks Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ import { AlertsContextValue } from '../../../../../triggers_actions_ui/public/ap
1212import { AlertContextMeta } from '../types' ;
1313import { MetricsExplorerMetric } from '../../../../common/http_api/metrics_explorer' ;
1414import React from 'react' ;
15- import { Expressions , defaultExpression } from './expression' ;
15+ import { Expressions } from './expression' ;
1616import { act } from 'react-dom/test-utils' ;
1717// eslint-disable-next-line @kbn/eslint/no-restricted-paths
1818import { Comparator } from '../../../../server/lib/alerting/metric_threshold/types' ;
1919
2020jest . mock ( '../../../containers/source/use_source_via_http' , ( ) => ( {
21- useSourceViaHttp : ( any ) => ( {
21+ useSourceViaHttp : ( ) => ( {
2222 source : { id : 'default' } ,
2323 createDerivedIndexPattern : ( ) => ( { fields : [ ] , title : 'metricbeat-*' } ) ,
2424 } ) ,
Original file line number Diff line number Diff line change @@ -643,7 +643,9 @@ const previewOptions = [
643643 } ) ,
644644 } ,
645645] ;
646- const previewDOMOptions = previewOptions . map ( ( o ) => omit ( o , 'shortText' ) ) ;
646+ const previewDOMOptions : Array < { text : string ; value : string } > = previewOptions . map ( ( o ) =>
647+ omit ( o , 'shortText' )
648+ ) ;
647649
648650const firedTimeLabel = i18n . translate ( 'xpack.infra.metrics.alertFlyout.firedTime' , {
649651 defaultMessage : 'time' ,
Original file line number Diff line number Diff line change @@ -18,15 +18,15 @@ jest.mock('react-router-dom', () => ({
1818
1919// Jest can't access variables outside the scope of the mock factory function except to
2020// reassign them, so we can't make these both part of the same object
21- let PREFILL_NODETYPE ;
22- let PREFILL_METRIC ;
21+ let PREFILL_NODETYPE : WaffleOptionsState [ 'nodeType' ] | undefined ;
22+ let PREFILL_METRIC : WaffleOptionsState [ 'metric' ] | undefined ;
2323jest . mock ( '../../../../alerting/use_alert_prefill' , ( ) => ( {
2424 useAlertPrefillContext : ( ) => ( {
2525 inventoryPrefill : {
26- setNodeType ( nodeType : string ) {
26+ setNodeType ( nodeType : WaffleOptionsState [ 'nodeType' ] ) {
2727 PREFILL_NODETYPE = nodeType ;
2828 } ,
29- setMetric ( metric : { type : string } ) {
29+ setMetric ( metric : WaffleOptionsState [ 'metric' ] ) {
3030 PREFILL_METRIC = metric ;
3131 } ,
3232 } ,
@@ -46,7 +46,7 @@ describe('useWaffleOptions', () => {
4646
4747 const newOptions = {
4848 nodeType : 'pod' ,
49- metriic : { type : 'memory' } ,
49+ metric : { type : 'memory' } ,
5050 } as WaffleOptionsState ;
5151 act ( ( ) => {
5252 result . current . changeNodeType ( newOptions . nodeType ) ;
You can’t perform that action at this time.
0 commit comments