-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05a2520
commit b715c3d
Showing
2 changed files
with
32 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
...es/BinaryRiskMatrix/BinaryRiskMatrixLogic/calculateLikelihood/calculateLikelihood.test.js
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,31 @@ | ||
import { calculateThreatScope } from "./calculateLikelihood"; | ||
|
||
describe("testing the calculateThreatScope function", () => { | ||
it("should return High if Q1 & Q2 are both true", () => { | ||
const expectValue = "High"; | ||
const Q1Value = true; | ||
const Q2Value = true; | ||
expect(calculateThreatScope(Q1Value, Q2Value)).toBe(expectValue); | ||
}); | ||
|
||
it("should return Low if Q1 & Q2 are both true", () => { | ||
const expectValue = "Low"; | ||
const Q1Value = false; | ||
const Q2Value = false; | ||
expect(calculateThreatScope(Q1Value, Q2Value)).toBe(expectValue); | ||
}); | ||
|
||
it("should return Medium if Q1 is true & Q2 is false", () => { | ||
const expectValue = "Medium"; | ||
const Q1Value = true; | ||
const Q2Value = false; | ||
expect(calculateThreatScope(Q1Value, Q2Value)).toBe(expectValue); | ||
}); | ||
|
||
it("should return Medium if Q1 is false & Q2 is true", () => { | ||
const expectValue = "Medium"; | ||
const Q1Value = false; | ||
const Q2Value = true; | ||
expect(calculateThreatScope(Q1Value, Q2Value)).toBe(expectValue); | ||
}); | ||
}); |