From d7b7bd1b28745040306239709e5ddea2947a499a Mon Sep 17 00:00:00 2001 From: Naz Date: Wed, 17 Nov 2021 17:51:58 +0400 Subject: [PATCH] Updated Users API e2e tests to use 'posts' fixture refs https://github.com/TryGhost/Toolbox/issues/135 - This way the test is performed on a "full" set of posts that will become unified within all e2e tests for performance optimization --- test/e2e-api/admin/users.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e-api/admin/users.test.js b/test/e2e-api/admin/users.test.js index fa5404ca10..42a27c224c 100644 --- a/test/e2e-api/admin/users.test.js +++ b/test/e2e-api/admin/users.test.js @@ -29,7 +29,7 @@ describe('User API', function () { }); // by default we login with the owner - await localUtils.doAuth(request); + await localUtils.doAuth(request, 'posts'); }); it('Can request all users ordered by id', async function () { @@ -65,11 +65,11 @@ describe('User API', function () { testUtils.API.isISO8601(jsonResponse.users[3].created_at).should.be.true(); testUtils.API.isISO8601(jsonResponse.users[3].updated_at).should.be.true(); - // only "ghost" author has a published post + // only "ghost" and joe-bloggs author has a published post jsonResponse.users[0].url.should.eql(`${config.get('url')}/404/`); jsonResponse.users[1].url.should.eql(`${config.get('url')}/404/`); jsonResponse.users[2].url.should.eql(`${config.get('url')}/author/ghost/`); - jsonResponse.users[3].url.should.eql(`${config.get('url')}/404/`); + jsonResponse.users[3].url.should.eql(`${config.get('url')}/author/joe-bloggs/`); }); it('Can include user roles', async function () { @@ -116,7 +116,7 @@ describe('User API', function () { localUtils.API.checkResponse(jsonResponse.users[0].roles[0], 'role', ['permissions']); should.exist(jsonResponse.users[0].count.posts); - jsonResponse.users[0].count.posts.should.equal(0); + jsonResponse.users[0].count.posts.should.equal(8); }); it('Can retrieve a user by slug', async function () {