From bbb5b64ec54e7993ae433764fdd1222e5ebe0600 Mon Sep 17 00:00:00 2001 From: Naz Date: Wed, 13 Sep 2023 13:06:27 +0800 Subject: [PATCH] Cleaned up member's neswletter test suite refs https://github.com/TryGhost/Arch/issues/87 - We just introduce member's newsletters serialization, so removed the comments reminding to do so. --- ghost/core/test/e2e-api/members/middleware.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ghost/core/test/e2e-api/members/middleware.test.js b/ghost/core/test/e2e-api/members/middleware.test.js index 0974c136d0..8f97b47966 100644 --- a/ghost/core/test/e2e-api/members/middleware.test.js +++ b/ghost/core/test/e2e-api/members/middleware.test.js @@ -8,6 +8,7 @@ let membersAgent; const memberMatcher = (newslettersCount) => { return { uuid: anyUuid, + // @NOTE: check if this field is even needed? it differs to the output in the other matcher created_at: anyISODateTime, newsletters: new Array(newslettersCount).fill( { @@ -17,8 +18,7 @@ const memberMatcher = (newslettersCount) => { }; }; -// @todo: we currently don't serialise the output of /api/member/newsletters/, we should fix this -const memberMatcherUnserialised = (newslettersCount) => { +const buildMemberMatcher = (newslettersCount) => { return { uuid: anyUuid, newsletters: new Array(newslettersCount).fill( @@ -66,7 +66,7 @@ describe('Comments API', function () { .matchHeaderSnapshot({ etag: anyEtag }) - .matchBodySnapshot(memberMatcherUnserialised(1)) + .matchBodySnapshot(buildMemberMatcher(1)) .expect(({body}) => { body.email.should.eql(member.get('email')); body.enable_comment_notifications.should.eql(false); @@ -186,7 +186,7 @@ describe('Comments API', function () { .matchHeaderSnapshot({ etag: anyEtag }) - .matchBodySnapshot(memberMatcherUnserialised(2)) + .matchBodySnapshot(buildMemberMatcher(2)) .expect(({body}) => { body.email.should.eql(member.get('email')); body.enable_comment_notifications.should.eql(true);