From 7b69dc7cfa118f5a1f42c5e95346f1c03676bbe4 Mon Sep 17 00:00:00 2001 From: rehabas Date: Fri, 3 Apr 2020 17:40:44 +0300 Subject: [PATCH] edit tests relates #12 --- server/controllers/routes/user/project/getProjectsByType.js | 2 +- test/index.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/controllers/routes/user/project/getProjectsByType.js b/server/controllers/routes/user/project/getProjectsByType.js index 013409e0..7d074185 100644 --- a/server/controllers/routes/user/project/getProjectsByType.js +++ b/server/controllers/routes/user/project/getProjectsByType.js @@ -11,7 +11,7 @@ const getProjectsData = async (req, res, next) => { if (rows.length > 0) { res.json({ statusCode: 200, - rows, + data: rows, }); } else { res.json({ diff --git a/test/index.test.js b/test/index.test.js index 5172297a..07705b45 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -182,7 +182,7 @@ describe('Get project by type', () => { .expect('Content-Type', /json/) .end((err, res) => { if (err) return done(err); - const { name } = res.body.rows[0]; + const { name } = res.body.data[0]; expect(name).toBe('Applicants System'); done(); });