Added e2e test for bulk member deletion (#15730)

ref https://github.com/TryGhost/Team/issues/1446

- tests the `delete` api endpoint method for deleting a bulk set of members.
This commit is contained in:
Ronald Langeveld 2022-11-08 17:02:55 +07:00 committed by GitHub
parent 4b7dd71851
commit 6214812ac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View File

@ -455,6 +455,19 @@ Object {
}
`;
exports[`Members API Bulk operations Can bulk delete members 1: [body] 1`] = `
Object {
"meta": Object {
"errors": Array [],
"stats": Object {
"successful": 8,
"unsuccessful": 0,
},
"unsuccessfulIds": Array [],
},
}
`;
exports[`Members API Bulk operations Can bulk unsubscribe members with deprecated subscribed filter (actual) 1: [body] 1`] = `
Object {
"bulk": Object {

View File

@ -2828,4 +2828,20 @@ describe('Members API Bulk operations', function () {
const updatedModel2 = await models.Member.findOne({id: member2.id}, {withRelated: 'labels'});
should(updatedModel2.relations.labels.models.map(m => m.id)).match([firstId, secondId]);
});
it('Can bulk delete members', async function () {
await agent
.delete('/members?all=true')
.expectStatus(200)
.matchBodySnapshot({
meta: {
stats: {
successful: 8,
unsuccessful: 0
},
unsuccessfulIds: [],
errors: []
}
});
});
});