Skip to content

Commit

Permalink
#6 testing calculateAttackEfficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewNobes committed Jun 14, 2022
1 parent 96b7a3b commit a5d5b04
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const calculateProtectionWeakness = (threatScore, Q3, Q4) => {
* @param {string} protectionWeakness The protection weakness (see calculateProtectionWeakness)
* @returns {string} The attack efficiency
*/
const calculateAttackEfficiency = (protectionWeakness) => {
export const calculateAttackEfficiency = (protectionWeakness) => {
return protectionWeakness;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
calculateThreatScope,
calculateProtectionWeakness,
calculateAttackEfficiency,
} from "./calculateLikelihood";

describe("testing the calculateThreatScope function", () => {
Expand Down Expand Up @@ -154,3 +155,23 @@ describe("testing the calculateProtectionWeakness function", () => {
);
});
});

describe("testing the calculateAttackEfficiency function", () => {
it("should return High if the protectionWeakness is High", () => {
const expectValue = "High";
const protectionWeakness = "High";
expect(calculateAttackEfficiency(protectionWeakness)).toBe(expectValue);
});

it("should return Medium if the protectionWeakness is Medium", () => {
const expectValue = "Medium";
const protectionWeakness = "Medium";
expect(calculateAttackEfficiency(protectionWeakness)).toBe(expectValue);
});

it("should return Low if the protectionWeakness is Low", () => {
const expectValue = "Low";
const protectionWeakness = "Low";
expect(calculateAttackEfficiency(protectionWeakness)).toBe(expectValue);
});
});

0 comments on commit a5d5b04

Please sign in to comment.