Skip to content

Commit

Permalink
Revert "Update test"
Browse files Browse the repository at this point in the history
This reverts commit f7be8c0.
  • Loading branch information
thewatermethod committed Apr 19, 2024
1 parent f7be8c0 commit ea31a7e
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/goalServices/getGoalIdsBySimiliarity.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jest/no-conditional-expect */
import faker from '@faker-js/faker';
import { REPORT_STATUSES } from '@ttahub/common';
import {
Expand Down Expand Up @@ -807,15 +808,10 @@ describe('getGoalIdsBySimilarity', () => {
expect(goalGroupSimilarityGroupGoals).toHaveLength(goalGroup.length);

goalGroupSimilarityGroupGoals.forEach((g) => {
let creationMethod = expect.any(String);
let status = expect.any(String);
if (g.excludedIfNotAdmin) {
creationMethod = CREATION_METHOD.CURATED;
status = GOAL_STATUS.CLOSED;
expect(g.goal.goalTemplate.creationMethod).toBe(CREATION_METHOD.CURATED);
expect(g.goal.status).toBe(GOAL_STATUS.CLOSED);
}

expect(g.goal.goalTemplate.creationMethod).toBe(creationMethod);
expect(g.goal.status).toBe(status);
});

const excludedIfNotAdminGoalGroup = goalGroupSimilarityGroupGoals
Expand Down Expand Up @@ -877,16 +873,12 @@ describe('getGoalIdsBySimilarity', () => {
expect(goalGroupSimilarityGroupGoals).toHaveLength(goalGroup.length);

goalGroupSimilarityGroupGoals.forEach((g) => {
let creationMethod = expect.any(String);
let status = expect.any(String);
if (g.excludedIfNotAdmin) {
creationMethod = CREATION_METHOD.CURATED;
status = GOAL_STATUS.CLOSED;
expect(g.goal.goalTemplate.creationMethod).toBe(CREATION_METHOD.CURATED);
expect(g.goal.status).toBe(GOAL_STATUS.CLOSED);
}

expect(g.goal.goalTemplate.creationMethod).toBe(creationMethod);
expect(g.goal.status).toBe(status);
});

const allowedIfNotAdmin = goalGroupSimilarityGroupGoals
.filter((g) => !g.excludedIfNotAdmin).map((g) => g.goal.id);

Expand Down

0 comments on commit ea31a7e

Please sign in to comment.