From e92f5fc56164f7326c2aef549a978064b342874a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 21 Sep 2021 17:12:59 -0400 Subject: [PATCH] fix: ban info test --- test/authentication.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/authentication.js b/test/authentication.js index ce92392d9d..fcf3084e5a 100644 --- a/test/authentication.js +++ b/test/authentication.js @@ -487,7 +487,15 @@ describe('authentication', () => { loginUser(bannedUser.username, bannedUser.pw, (err, res, body) => { assert.ifError(err); assert.equal(res.statusCode, 403); - assert.equal(body, '[[error:user-banned-reason, spammer]]'); + delete body.timestamp; + assert.deepStrictEqual(body, { + banned_until: 0, + banned_until_readable: '', + expiry: 0, + expiry_readable: '', + reason: 'spammer', + uid: 6, + }); user.bans.unban(bannedUser.uid, (err) => { assert.ifError(err); const expiry = Date.now() + 10000; @@ -496,7 +504,8 @@ describe('authentication', () => { loginUser(bannedUser.username, bannedUser.pw, (err, res, body) => { assert.ifError(err); assert.equal(res.statusCode, 403); - assert.equal(body, `[[error:user-banned-reason-until, ${utils.toISOString(expiry)}, No reason given.]]`); + assert(body.banned_until); + assert(body.reason, '[[user:info.banned-no-reason]]'); done(); }); });