-
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
2e61f7a
commit 05a2520
Showing
2 changed files
with
19 additions
and
10 deletions.
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
27 changes: 18 additions & 9 deletions
27
src/features/BinaryRiskMatrix/BinaryRiskMatrixLogic/calculateRisk/calculateRisk.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 |
---|---|---|
@@ -1,55 +1,64 @@ | ||
import { calculateRisk } from "./calculateRisk"; | ||
|
||
test("takes in a likelihood of High, impact of High and returns High for its risk", () => { | ||
const expectedRisk = "High"; | ||
const likelihood = "High"; | ||
const impact = "High"; | ||
expect(calculateRisk(likelihood, impact)).toBe("High"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of Medium, impact of Medium and returns Medium for its risk", () => { | ||
const expectedRisk = "Medium"; | ||
const likelihood = "Medium"; | ||
const impact = "Medium"; | ||
expect(calculateRisk(likelihood, impact)).toBe("Medium"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of Low, impact of Low and returns Low for its risk", () => { | ||
const expectedRisk = "Low"; | ||
const likelihood = "Low"; | ||
const impact = "Low"; | ||
expect(calculateRisk(likelihood, impact)).toBe("Low"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of Low, impact of Medium and returns Medium for its risk", () => { | ||
const expectedRisk = "Medium"; | ||
const likelihood = "Low"; | ||
const impact = "Medium"; | ||
expect(calculateRisk(likelihood, impact)).toBe("Medium"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of Low, impact of High and returns Medium for its risk", () => { | ||
const expectedRisk = "Medium"; | ||
const likelihood = "Low"; | ||
const impact = "High"; | ||
expect(calculateRisk(likelihood, impact)).toBe("Medium"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of Medium, impact of Low and returns Low for its risk", () => { | ||
const expectedRisk = "Low"; | ||
const likelihood = "Medium"; | ||
const impact = "Low"; | ||
expect(calculateRisk(likelihood, impact)).toBe("Low"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of Medium, impact of High and returns High for its risk", () => { | ||
const expectedRisk = "High"; | ||
const likelihood = "Medium"; | ||
const impact = "High"; | ||
expect(calculateRisk(likelihood, impact)).toBe("High"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of High, impact of Low and returns Medium for its risk", () => { | ||
const expectedRisk = "Medium"; | ||
const likelihood = "High"; | ||
const impact = "Low"; | ||
expect(calculateRisk(likelihood, impact)).toBe("Medium"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); | ||
|
||
test("takes in a likelihood of High, impact of Medium and returns High for its risk", () => { | ||
const expectedRisk = "High"; | ||
const likelihood = "High"; | ||
const impact = "Medium"; | ||
expect(calculateRisk(likelihood, impact)).toBe("High"); | ||
expect(calculateRisk(likelihood, impact)).toBe(expectedRisk); | ||
}); |