From 36aaf14d7fe6cdf6b139315a573f11f4c61bc574 Mon Sep 17 00:00:00 2001 From: namjiyun Date: Tue, 10 Jan 2023 13:30:53 +0900 Subject: [PATCH] test: #57 add mission test code --- src/test/mission.spec.ts | 49 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/test/mission.spec.ts b/src/test/mission.spec.ts index 983e37f..5a37363 100644 --- a/src/test/mission.spec.ts +++ b/src/test/mission.spec.ts @@ -275,7 +275,7 @@ describe('GET /mission/month/:month', () => { // 월별 조회 200 케이스 it('월별 조회 - 성공', (done) => { req(app) - .get('/api/mission/month/:month') + .get(`/api/mission/month/${2023-01}`) .set('Content-Type', 'application/json') .set({ Authorization: `${process.env.TEST_ACCESS_TOKEN}` }) .expect(200) @@ -289,3 +289,50 @@ describe('GET /mission/month/:month', () => { }); }); }); + + +/** + * 낫투두 통계 + * 200 케이스 + */ +describe('GET /mission/stat/notTodo', () => { + // 낫투두 통계 200 케이스 + it('낫투두 통계 조회 - 성공', (done) => { + req(app) + .get('/api/mission/stat/notTodo') + .set('Content-Type', 'application/json') + .set({ Authorization: `${process.env.TEST_ACCESS_TOKEN}` }) + .expect(200) + .expect('Content-Type', /json/) + .then((res) => { + done(); + }) + .catch((err) => { + console.error('######Error >>', err); + done(err); + }); + }); +}); + +/** + * 상황별 통계 + * 200 케이스 + */ +describe('GET /mission/stat/situation', () => { + // 상황별 통계 200 케이스 + it('상황별 통계 조회 - 성공', (done) => { + req(app) + .get('/api/mission/stat/situation') + .set('Content-Type', 'application/json') + .set({ Authorization: `${process.env.TEST_ACCESS_TOKEN}` }) + .expect(200) + .expect('Content-Type', /json/) + .then((res) => { + done(); + }) + .catch((err) => { + console.error('######Error >>', err); + done(err); + }); + }); +}); \ No newline at end of file