From ea31a7eb72d62be98dbfd6b000df36bf8e730879 Mon Sep 17 00:00:00 2001 From: Matt Bevilacqua Date: Fri, 19 Apr 2024 14:52:09 -0400 Subject: [PATCH] Revert "Update test" This reverts commit f7be8c04bff6434dcef6ec085acc07c6f9c6df9d. --- .../getGoalIdsBySimiliarity.test.js | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/goalServices/getGoalIdsBySimiliarity.test.js b/src/goalServices/getGoalIdsBySimiliarity.test.js index d44aa2de9b..4639785b80 100644 --- a/src/goalServices/getGoalIdsBySimiliarity.test.js +++ b/src/goalServices/getGoalIdsBySimiliarity.test.js @@ -1,3 +1,4 @@ +/* eslint-disable jest/no-conditional-expect */ import faker from '@faker-js/faker'; import { REPORT_STATUSES } from '@ttahub/common'; import { @@ -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 @@ -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);