Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marsavar committed Jul 4, 2024
1 parent c295d2a commit f377dec
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/cloudbuster/src/findings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('FBSP SLA window', () => {
expect(isWithinSla).toBe(true);
});

it('Returns true if a critical finding was first observed within a day', () => {
it('Returns true if a high finding was first observed within a day', () => {
const firstObservedAt = new Date(MOCK_ONE_DAY_AGO);
const severity = 'HIGH';

Expand Down Expand Up @@ -61,4 +61,13 @@ describe('FBSP SLA window', () => {
const isWithinSla = isWithinSlaTime(firstObservedAt, severity);
expect(isWithinSla).toBe(false);
});

it('Returns false if a critical finding has no information about when it was first observed', () => {
// This can happen as it's a nullable column in the DB
const firstObservedAt = null;
const severity = 'CRITICAL';

const isWithinSla = isWithinSlaTime(firstObservedAt, severity);
expect(isWithinSla).toBe(false);
});
});

0 comments on commit f377dec

Please sign in to comment.