Skip to content

Commit 6bb5f17

Browse files
committed
Update tests
1 parent e9d8aac commit 6bb5f17

3 files changed

Lines changed: 10 additions & 19 deletions

File tree

x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_score_fill_color.test.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { renderHook } from '@testing-library/react';
99
import { useRiskScoreFillColor } from './use_risk_score_fill_color';
1010
import { emptyDonutColor } from '../../../common/components/charts/donutchart_empty';
11-
import { SEVERITY_UI_SORT_ORDER } from '../../common';
11+
import { SEVERITY_UI_SORT_ORDER, RISK_SEVERITY_COLOUR } from '../../common';
1212
import { TestProviders } from '../../../common/mock';
1313

1414
describe('useRiskScoreFillColor', () => {
@@ -17,15 +17,7 @@ describe('useRiskScoreFillColor', () => {
1717

1818
const colors = SEVERITY_UI_SORT_ORDER.map((severity) => result.current(severity));
1919

20-
expect(colors).toMatchInlineSnapshot(`
21-
Array [
22-
"#aaa",
23-
"#54B399",
24-
"#D6BF57",
25-
"#DA8B45",
26-
"#E7664C",
27-
]
28-
`);
20+
expect(colors).toStrictEqual(Object.values(RISK_SEVERITY_COLOUR));
2921
});
3022

3123
it('returns the empty donut color for an invalid risk severity', () => {

x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/common/index.test.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { EuiHealth, useEuiTheme } from '@elastic/eui';
1616

1717
import { RiskSeverity } from '../../../../../common/search_strategy';
1818
import { RiskScoreLevel } from '.';
19-
import { SEVERITY_COLOR } from '../../../../overview/components/detection_response/utils';
2019

2120
jest.mock('@elastic/eui', () => {
2221
const original = jest.requireActual('@elastic/eui');
@@ -37,7 +36,7 @@ describe('RiskScore', () => {
3736

3837
expect(container).toHaveTextContent(RiskSeverity.Critical);
3938
expect(EuiHealth as jest.Mock).toHaveBeenLastCalledWith(
40-
expect.objectContaining({ color: SEVERITY_COLOR.critical }),
39+
expect.objectContaining({ color: euiThemeVars.euiColorSeverityDanger }),
4140
{}
4241
);
4342
});
@@ -52,7 +51,7 @@ describe('RiskScore', () => {
5251
expect(container).toHaveTextContent(RiskSeverity.High);
5352

5453
expect(EuiHealth as jest.Mock).toHaveBeenLastCalledWith(
55-
expect.objectContaining({ color: SEVERITY_COLOR.high }),
54+
expect.objectContaining({ color: euiThemeVars.euiColorSeverityRisk }),
5655
context
5756
);
5857
});
@@ -67,7 +66,7 @@ describe('RiskScore', () => {
6766
expect(container).toHaveTextContent(RiskSeverity.Moderate);
6867

6968
expect(EuiHealth as jest.Mock).toHaveBeenLastCalledWith(
70-
expect.objectContaining({ color: SEVERITY_COLOR.medium }),
69+
expect.objectContaining({ color: euiThemeVars.euiColorSeverityWarning }),
7170
context
7271
);
7372
});
@@ -82,7 +81,7 @@ describe('RiskScore', () => {
8281
expect(container).toHaveTextContent(RiskSeverity.Low);
8382

8483
expect(EuiHealth as jest.Mock).toHaveBeenLastCalledWith(
85-
expect.objectContaining({ color: SEVERITY_COLOR.low }),
84+
expect.objectContaining({ color: euiThemeVars.euiColorSeverityNeutral }),
8685
context
8786
);
8887
});

x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_summary.test.ts.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)