From f30286c3bd716bea8968a0299462719c7ea94068 Mon Sep 17 00:00:00 2001 From: summerM Date: Wed, 13 Nov 2024 20:31:06 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=AA=A8=ED=82=B9=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/node/node.controller.ts | 1 - backend/src/page/page.service.spec.ts | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/backend/src/node/node.controller.ts b/backend/src/node/node.controller.ts index 3833101d..18a6f475 100644 --- a/backend/src/node/node.controller.ts +++ b/backend/src/node/node.controller.ts @@ -20,7 +20,6 @@ import { CoordinateResponseDto } from './dtos/coordinateResponse.dto'; import { FindNodeResponseDto } from './dtos/findNodeResponse.dto'; import { FindNodesResponseDto } from './dtos/findNodesResponse.dto.'; - export enum NodeResponseMessage { NODE_RETURNED = '노드와 페이지를 가져왔습니다.', NODE_ALL_RETURNED = '모든 노드를 가져왔습니다.', diff --git a/backend/src/page/page.service.spec.ts b/backend/src/page/page.service.spec.ts index 890b5d29..8202e32a 100644 --- a/backend/src/page/page.service.spec.ts +++ b/backend/src/page/page.service.spec.ts @@ -58,14 +58,14 @@ describe('PageService', () => { x: 1, y: 1, }; - + const newDate = new Date(); // 페이지 엔티티 const newPage: Page = { id: 1, title: 'new page', content: {} as JSON, - createdAt: new Date(), - updatedAt: new Date(), + createdAt: newDate, + updatedAt: newDate, version: 1, node: null, }; @@ -122,22 +122,24 @@ describe('PageService', () => { title: 'Updated Title', content: {} as JSON, }; + const originDate = new Date(); const originPage: Page = { id: 1, title: 'origin title', content: {} as JSON, node: null, - createdAt: new Date(), - updatedAt: new Date(), + createdAt: originDate, + updatedAt: originDate, version: 1, }; + const newDate = new Date(); const newPage: Page = { id: 1, title: 'Updated Title', content: {} as JSON, node: null, - createdAt: new Date(), - updatedAt: new Date(), + createdAt: newDate, + updatedAt: newDate, version: 1, }; @@ -166,13 +168,14 @@ describe('PageService', () => { describe('findPageById', () => { it('id에 해당하는 페이지를 찾아 성공적으로 반환한다.', async () => { + const newDate = new Date(); const expectedPage: Page = { id: 1, title: 'title', content: {} as JSON, node: null, - createdAt: new Date(), - updatedAt: new Date(), + createdAt: newDate, + updatedAt: newDate, version: 1, }; jest.spyOn(pageRepository, 'findOneBy').mockResolvedValue(expectedPage);