From 76dc856dbffb7a4bd5de8d150a69c17a0f5dcb25 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 20 Sep 2024 15:37:21 +0200 Subject: [PATCH] test: fix system test --- src/routes/test/system-test.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/routes/test/system-test.js b/src/routes/test/system-test.js index 5391ba07e..70ca35075 100644 --- a/src/routes/test/system-test.js +++ b/src/routes/test/system-test.js @@ -118,12 +118,13 @@ describe('System', function () { expect(response.body.swap).to.be.a('number'); }); - it('fails (non-admin)', async function () { + it('succeeds (admin)', async function () { const response = await superagent.get(`${serverUrl}/api/v1/system/memory`) - .query({ access_token: user.token }) - .ok(() => true); + .query({ access_token: user.token }); - expect(response.statusCode).to.equal(403); + expect(response.statusCode).to.equal(200); + expect(response.body.memory).to.eql(os.totalmem()); + expect(response.body.swap).to.be.a('number'); }); });