Skip to content

Commit

Permalink
Tidy up factories
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku committed May 24, 2023
1 parent c260e26 commit 33b4197
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions assets/js/lib/test-utils/factories/executions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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);

Expand Down

0 comments on commit 33b4197

Please sign in to comment.