mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 03:14:03 +03:00
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:
parent
4b7dd71851
commit
6214812ac0
@ -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 {
|
||||
|
@ -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: []
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user