Skip to content

Commit

Permalink
[Security Solution] Update case for hard-coded hex values in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acstll committed Jan 28, 2025
1 parent f98fe23 commit 20b7f95
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jest.mock('@elastic/eui', () => ({
}));

const EXPECTED_SEVERITY_COLOR_AMSTERDAM = {
low: '#54b399',
medium: '#f1d86f',
high: '#ff7e62',
low: '#54B399',
medium: '#F1D86F',
high: '#FF7E62',
critical: '#bd271e',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ describe('getFillColor', () => {
});

it('returns the expected fill color when risk score is 100', () => {
expect(getFillColor({ riskScore: 100, colorPalette })).toEqual('#BD271E');
expect(getFillColor({ riskScore: 100, colorPalette })).toEqual('#bd271e');
});

it('returns the expected fill color when risk score is greater than 100', () => {
expect(getFillColor({ riskScore: 101, colorPalette })).toEqual('#BD271E');
expect(getFillColor({ riskScore: 101, colorPalette })).toEqual('#bd271e');
});

it('returns the expected fill color when risk score is greater than RISK_SCORE_CRITICAL', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('layers', () => {
const dataName = 'mimikatz process started';
expect(
getLayersOneDimension({ colorPalette, maxRiskSubAggregations })[0].shape.fillColor(dataName)
).toEqual('#BD271E');
).toEqual('#bd271e');
});

it('return the default fill color when dataName is not found in the maxRiskSubAggregations', () => {
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('layers', () => {
{ index: 0, value: 'Host-k8iyfzraq9' },
],
})
).toEqual('#BD271E');
).toEqual('#bd271e');
});

it('returns the default fillColor for layer 1 when the group from path is not found', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@ describe('getFlattenedLegendItems', () => {
value: 'mimikatz process started',
},
{
color: '#BD271E',
color: '#bd271e',
count: 3,
field: 'host.name',
value: 'Host-k8iyfzraq9',
},
{
color: '#BD271E',
color: '#bd271e',
count: 1,
field: 'host.name',
value: 'Host-3fbljiq8rj',
},
{
color: '#BD271E',
color: '#bd271e',
count: 1,
field: 'host.name',
value: 'Host-r4y6xi92ob',
Expand All @@ -135,7 +135,7 @@ describe('getFlattenedLegendItems', () => {
value: 'Threshold rule',
},
{
color: '#BD271E',
color: '#bd271e',
count: 1,
field: 'host.name',
value: 'Host-r4y6xi92ob',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,21 @@ describe('legend', () => {
scopeId: TableId.alertsOnAlertsPage,
},
{
color: '#FF7E62',
color: '#F1D86F',
count: 19,
field: 'kibana.alert.rule.name',
value: 'Endpoint Security',
scopeId: TableId.alertsOnAlertsPage,
},
{
color: '#BD271E',
color: '#bd271e',
count: 5,
field: 'kibana.alert.rule.name',
value: 'mimikatz process started',
scopeId: TableId.alertsOnAlertsPage,
},
{
color: '#BD271E',
color: '#bd271e',
count: 1,
field: 'kibana.alert.rule.name',
value: 'Threshold rule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ describe('parse severity data', () => {

describe.each([
{ severity: 'critical', colorToken: '#bd271e', themeName: 'Amsterdam' },
{ severity: 'high', colorToken: '#ff7e62', themeName: 'Amsterdam' },
{ severity: 'medium', colorToken: '#f1d86f', themeName: 'Amsterdam' },
{ severity: 'low', colorToken: '#54b399', themeName: 'Amsterdam' },
{ severity: 'high', colorToken: '#FF7E62', themeName: 'Amsterdam' },
{ severity: 'medium', colorToken: '#F1D86F', themeName: 'Amsterdam' },
{ severity: 'low', colorToken: '#54B399', themeName: 'Amsterdam' },
{ severity: 'critical', colorToken: '#E7664C', themeName: 'Borealis' },
{ severity: 'high', colorToken: '#DA8B45', themeName: 'Borealis' },
{ severity: 'medium', colorToken: '#D6BF57', themeName: 'Borealis' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ describe('getFormattedAlertStats', () => {
it('should return alert stats', () => {
const alertStats = getFormattedAlertStats(mockAlertData, euiTheme);
expect(alertStats).toEqual([
{ key: 'High', count: 2, color: '#ff7e62' },
{ key: 'Low', count: 2, color: '#54b399' },
{ key: 'Medium', count: 2, color: '#f1d86f' },
{ key: 'High', count: 2, color: '#FF7E62' },
{ key: 'Low', count: 2, color: '#54B399' },
{ key: 'Medium', count: 2, color: '#F1D86F' },
{ key: 'Critical', count: 2, color: '#bd271e' },
]);
});
Expand Down

0 comments on commit 20b7f95

Please sign in to comment.