From 4e85da4e783c217660a561414b4a2c92e18d15b7 Mon Sep 17 00:00:00 2001 From: pithesun Date: Sat, 28 Sep 2024 23:24:58 +0900 Subject: [PATCH] =?UTF-8?q?feature(view)=20:=20=ED=81=B4=EB=9F=AC=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=20=EC=BB=A4=EB=B0=8B=20=EC=9E=91=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EC=A4=91=EB=B3=B5=20=EC=B2=B4=ED=81=AC=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=9E=91=EC=84=B1(#723)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Summary/Summary.util.test.ts | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/view/src/components/VerticalClusterList/Summary/Summary.util.test.ts b/packages/view/src/components/VerticalClusterList/Summary/Summary.util.test.ts index ec3bbae8..4578be59 100644 --- a/packages/view/src/components/VerticalClusterList/Summary/Summary.util.test.ts +++ b/packages/view/src/components/VerticalClusterList/Summary/Summary.util.test.ts @@ -84,11 +84,21 @@ test("getClusterIds test", () => { expect(result).toHaveLength(2); }); -test("getInitData test", () => { +describe("getInitData test", () => { const result = getInitData(clusterNodeMockData); - expect(result).not.toBeUndefined(); - expect(result[0].clusterId).toBe(0); - expect(result[0].summary.authorNames[0][0]).toBe("ytaek"); - expect(result[0].summary.content.message).toBe("Initial commit"); + test("getInitData test", () => { + expect(result).not.toBeUndefined(); + expect(result[0].clusterId).toBe(0); + expect(result[0].summary.authorNames[0][0]).toBe("ytaek"); + expect(result[0].summary.content.message).toBe("Initial commit"); + }); + + test("클러스터의 커밋 작성자 이름이 중복되지 않는다.", () => { + const isUnique = result + .map((data) => data.summary.authorNames.length === new Set(data.summary.authorNames).size) + .every((value) => value === true); + + expect(isUnique).toBe(true); + }); });