From 2b32b043708c0d5b7d5fe7c103aa0b734168a67a Mon Sep 17 00:00:00 2001 From: Nelson Kopliku Date: Wed, 24 May 2023 14:53:44 +0200 Subject: [PATCH] Tidy up factories --- .../js/lib/test-utils/factories/executions.js | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/assets/js/lib/test-utils/factories/executions.js b/assets/js/lib/test-utils/factories/executions.js index 5a5c6cb181..f7fd136d95 100644 --- a/assets/js/lib/test-utils/factories/executions.js +++ b/assets/js/lib/test-utils/factories/executions.js @@ -226,17 +226,6 @@ export const addPassingExpectation = (checkResult, type, expectationName) => { return addExpectation(checkResult, name, expectation, true); }; -export const addCriticalExpectation = (checkResult, type, expectationName) => { - const name = expectationName || faker.company.name(); - const expectation = executionExpectationEvaluationFactory.build({ - name, - type, - return_value: false, - }); - - return addExpectation(checkResult, name, expectation, false); -}; - export const addExpectationWithError = (checkResult, expectationName) => { const name = expectationName || faker.company.name(); const expectation = executionExpectationEvaluationErrorFactory.build({ @@ -249,9 +238,15 @@ export const addExpectationWithError = (checkResult, expectationName) => { export const addPassingExpectExpectation = (checkResult, expectationName) => addPassingExpectation(checkResult, 'expect', expectationName); -export const addCriticalExpectExpectation = (checkResult, expectationName) => - addCriticalExpectation(checkResult, 'expect', expectationName); +export const addCriticalExpectExpectation = (checkResult, expectationName) => { + const name = expectationName || faker.company.name(); + const expectation = failingExpectEvaluationFactory.build({ + name, + return_value: false, + }); + return addExpectation(checkResult, name, expectation, false); +}; export const addPassingExpectSameExpectation = (checkResult, expectationName) => addPassingExpectation(checkResult, 'expect_same', expectationName);