diff --git a/test/regression/api/canary/admin/members_spec.js b/test/regression/api/canary/admin/members_spec.js index 4ed64f7bed..df85acc885 100644 --- a/test/regression/api/canary/admin/members_spec.js +++ b/test/regression/api/canary/admin/members_spec.js @@ -286,57 +286,6 @@ describe('Members API (canary)', function () { }); }); - // NOTE: this test should be enabled and expanded once test suite fully supports Stripe mocking - it.skip('Can set a "Complimentary" subscription', function () { - const memberToChange = { - name: 'Comped Member', - email: 'member2comp@test.com' - }; - - const memberChanged = { - comped: true - }; - - return request - .post(localUtils.API.getApiQuery(`members/`)) - .send({members: [memberToChange]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(201) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - const jsonResponse = res.body; - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - - return jsonResponse.members[0]; - }) - .then((newMember) => { - return request - .put(localUtils.API.getApiQuery(`members/${newMember.id}/`)) - .send({members: [memberChanged]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(200) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - - const jsonResponse = res.body; - - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - localUtils.API.checkResponse(jsonResponse.members[0], 'member', 'subscriptions'); - jsonResponse.members[0].name.should.equal(memberToChange.name); - jsonResponse.members[0].email.should.equal(memberToChange.email); - jsonResponse.members[0].comped.should.equal(memberToChange.comped); - }); - }); - }); - it('Can delete a member without cancelling Stripe Subscription', async function () { const member = { name: 'Member 2 Delete', @@ -372,80 +321,6 @@ describe('Members API (canary)', function () { }); }); - // NOTE: this test should be enabled and expanded once test suite fully supports Stripe mocking - it.skip('Can delete a member and cancel Stripe Subscription', async function () { - const member = { - name: 'Member 2 Delete', - email: 'Member2Delete@test.com', - comped: true - }; - - const createdMember = await request.post(localUtils.API.getApiQuery(`members/`)) - .send({members: [member]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(201) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - const jsonResponse = res.body; - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - - return jsonResponse.members[0]; - }); - - await request.delete(localUtils.API.getApiQuery(`members/${createdMember.id}/?cancel=true`)) - .set('Origin', config.get('url')) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(204) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - - const jsonResponse = res.body; - - should.exist(jsonResponse); - }); - }); - - // NOTE: this test should be enabled and expanded once test suite fully supports Stripe mocking - it.skip('Does not cancel Stripe Subscription if cancel_subscriptions is not set to "true"', async function () { - const member = { - name: 'Member 2 Delete', - email: 'Member2Delete@test.com', - comped: true - }; - - const createdMember = await request.post(localUtils.API.getApiQuery(`members/`)) - .send({members: [member]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(201) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - const jsonResponse = res.body; - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - - return jsonResponse.members[0]; - }); - - await request.delete(localUtils.API.getApiQuery(`members/${createdMember.id}/?cancel=false`)) - .set('Origin', config.get('url')) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(204) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - - const jsonResponse = res.body; - - should.exist(jsonResponse); - }); - }); - it('Can import CSV with minimum one field and labels', function () { let importLabel; diff --git a/test/regression/api/v3/admin/members_spec.js b/test/regression/api/v3/admin/members_spec.js index 5296fd2730..e8999cba5e 100644 --- a/test/regression/api/v3/admin/members_spec.js +++ b/test/regression/api/v3/admin/members_spec.js @@ -245,57 +245,6 @@ describe('Members API', function () { }); }); - // NOTE: this test should be enabled and expanded once test suite fully supports Stripe mocking - it.skip('Can set a "Complimentary" subscription', function () { - const memberToChange = { - name: 'Comped Member', - email: 'member2comp@test.com' - }; - - const memberChanged = { - comped: true - }; - - return request - .post(localUtils.API.getApiQuery(`members/`)) - .send({members: [memberToChange]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(201) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - const jsonResponse = res.body; - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - - return jsonResponse.members[0]; - }) - .then((newMember) => { - return request - .put(localUtils.API.getApiQuery(`members/${newMember.id}/`)) - .send({members: [memberChanged]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(200) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - - const jsonResponse = res.body; - - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - localUtils.API.checkResponse(jsonResponse.members[0], 'member', 'stripe'); - jsonResponse.members[0].name.should.equal(memberToChange.name); - jsonResponse.members[0].email.should.equal(memberToChange.email); - jsonResponse.members[0].comped.should.equal(memberToChange.comped); - }); - }); - }); - it('Can delete a member without cancelling Stripe Subscription', async function () { const member = { name: 'Member 2 Delete', @@ -331,80 +280,6 @@ describe('Members API', function () { }); }); - // NOTE: this test should be enabled and expanded once test suite fully supports Stripe mocking - it.skip('Can delete a member and cancel Stripe Subscription', async function () { - const member = { - name: 'Member 2 Delete', - email: 'Member2Delete@test.com', - comped: true - }; - - const createdMember = await request.post(localUtils.API.getApiQuery(`members/`)) - .send({members: [member]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(201) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - const jsonResponse = res.body; - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - - return jsonResponse.members[0]; - }); - - await request.delete(localUtils.API.getApiQuery(`members/${createdMember.id}/?cancel=true`)) - .set('Origin', config.get('url')) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(204) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - - const jsonResponse = res.body; - - should.exist(jsonResponse); - }); - }); - - // NOTE: this test should be enabled and expanded once test suite fully supports Stripe mocking - it.skip('Does not cancel Stripe Subscription if cancel_subscriptions is not set to "true"', async function () { - const member = { - name: 'Member 2 Delete', - email: 'Member2Delete@test.com', - comped: true - }; - - const createdMember = await request.post(localUtils.API.getApiQuery(`members/`)) - .send({members: [member]}) - .set('Origin', config.get('url')) - .expect('Content-Type', /json/) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(201) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - const jsonResponse = res.body; - should.exist(jsonResponse); - should.exist(jsonResponse.members); - jsonResponse.members.should.have.length(1); - - return jsonResponse.members[0]; - }); - - await request.delete(localUtils.API.getApiQuery(`members/${createdMember.id}/?cancel=false`)) - .set('Origin', config.get('url')) - .expect('Cache-Control', testUtils.cacheRules.private) - .expect(204) - .then((res) => { - should.not.exist(res.headers['x-cache-invalidate']); - - const jsonResponse = res.body; - - should.exist(jsonResponse); - }); - }); - it('Can import CSV with minimum one field and labels', function () { let importLabel;