diff --git a/core/server/services/members/api.js b/core/server/services/members/api.js index 4d36ea8af3..dbaec1d305 100644 --- a/core/server/services/members/api.js +++ b/core/server/services/members/api.js @@ -13,6 +13,7 @@ const SingleUseTokenProvider = require('./SingleUseTokenProvider'); const urlUtils = require('../../../shared/url-utils'); const labsService = require('../../../shared/labs'); const offersService = require('../offers'); +const getNewslettersServiceInstance = require('../newsletters'); const MAGIC_LINK_TOKEN_VALIDITY = 24 * 60 * 60 * 1000; @@ -195,7 +196,8 @@ function createApiInstance(config) { }, stripeAPIService: stripeService.api, offersAPI: offersService.api, - labsService: labsService + labsService: labsService, + newslettersService: getNewslettersServiceInstance({NewsletterModel: models.Newsletter}) }); return membersApiInstance; diff --git a/core/server/services/newsletters/index.js b/core/server/services/newsletters/index.js new file mode 100644 index 0000000000..7cf6d53891 --- /dev/null +++ b/core/server/services/newsletters/index.js @@ -0,0 +1,10 @@ +const NewslettersService = require('./service.js'); + +/** + * @returns {NewslettersService} instance of the NewslettersService + */ +const getNewslettersServiceInstance = ({NewsletterModel}) => { + return new NewslettersService({NewsletterModel}); +}; + +module.exports = getNewslettersServiceInstance; diff --git a/core/server/services/newsletters/service.js b/core/server/services/newsletters/service.js new file mode 100644 index 0000000000..98ce782c1e --- /dev/null +++ b/core/server/services/newsletters/service.js @@ -0,0 +1,24 @@ +class NewslettersService { + /** + * + * @param {Object} options + * @param {Object} options.NewsletterModel + */ + constructor({NewsletterModel}) { + this.NewsletterModel = NewsletterModel; + } + + /** + * + * @param {Object} options browse options + * @returns + */ + async browse(options) { + let newsletters = await this.NewsletterModel.findAll(options); + + return newsletters.toJSON(); + } +} + +module.exports = NewslettersService; + diff --git a/package.json b/package.json index 99993b78c2..a8f96cf390 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "@tryghost/logging": "2.1.2", "@tryghost/magic-link": "1.0.21", "@tryghost/member-events": "0.4.1", - "@tryghost/members-api": "5.5.0", + "@tryghost/members-api": "5.6.0", "@tryghost/members-events-service": "0.3.2", "@tryghost/members-importer": "0.5.6", "@tryghost/members-offers": "0.10.9", diff --git a/test/e2e-api/admin/__snapshots__/members.test.js.snap b/test/e2e-api/admin/__snapshots__/members.test.js.snap index b3aa561d95..c90e2eb60a 100644 --- a/test/e2e-api/admin/__snapshots__/members.test.js.snap +++ b/test/e2e-api/admin/__snapshots__/members.test.js.snap @@ -356,198 +356,6 @@ Object { } `; -exports[`Members API Can add complimentary subscription by assigning a product to a member 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest2@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Name", - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API Can add complimentary subscription by assigning a product to a member 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "445", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API Can add complimentary subscription by assigning a product to a member 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": true, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest2@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Name", - "note": null, - "products": Array [ - Object { - "active": true, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "description": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "monthly_price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "name": "Default Product", - "slug": "default-product", - "type": "paid", - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "visibility": "public", - "welcome_page_url": "/welcome-paid", - "yearly_price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - }, - ], - "status": "comped", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API Can add complimentary subscription by assigning a product to a member 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1730", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API Can add complimentary subscription in the new way 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest2@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Name", - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API Can add complimentary subscription in the new way 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "445", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API Can add complimentary subscription in the new way 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": true, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest2@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Name", - "note": null, - "products": Array [ - Object { - "active": true, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "description": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "monthly_price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "name": "Default Product", - "slug": "default-product", - "type": "paid", - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "visibility": "public", - "welcome_page_url": "/welcome-paid", - "yearly_price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - }, - ], - "status": "comped", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API Can add complimentary subscription in the new way 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1730", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - exports[`Members API Can browse 1: [body] 1`] = ` Object { "members": Array [ @@ -973,8 +781,6 @@ Object { } `; -exports[`Members API Can delete a member without cancelling Stripe Subscription 1: [body] 1`] = `Object {}`; - exports[`Members API Can delete a member without cancelling Stripe Subscription 1: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", @@ -985,16 +791,6 @@ Object { } `; -exports[`Members API Can delete a member without cancelling Stripe Subscription 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin", - "x-powered-by": "Express", -} -`; - exports[`Members API Can destroy 1: [body] 1`] = ` Object { "members": Array [ @@ -1063,23 +859,6 @@ Object { } `; -exports[`Members API Can destroy 5: [body] 1`] = ` -Object { - "errors": Array [ - Object { - "code": null, - "context": "Member not found.", - "details": null, - "help": null, - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Resource not found error, cannot read member.", - "property": null, - "type": "NotFoundError", - }, - ], -} -`; - exports[`Members API Can destroy 5: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", @@ -1092,18 +871,6 @@ Object { } `; -exports[`Members API Can destroy 6: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "224", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - exports[`Members API Can edit by id 1: [body] 1`] = ` Object { "members": Array [ @@ -1132,34 +899,6 @@ Object { } `; -exports[`Members API Can edit by id 2: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2Change@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "change me", - "note": "initial note", - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - exports[`Members API Can edit by id 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", @@ -1201,47 +940,6 @@ Object { } `; -exports[`Members API Can edit by id 3: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "462", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API Can edit by id 4: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "cantChangeMe@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "changed", - "note": "edited note", - "products": Array [], - "status": "free", - "subscribed": false, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - exports[`Members API Can edit by id 4: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", @@ -1254,20 +952,6 @@ Object { } `; -exports[`Members API Can edit by id 5: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "459", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API Can export CSV 1: [body] 1`] = `Object {}`; - exports[`Members API Can export CSV 1: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", @@ -1281,21 +965,6 @@ Object { } `; -exports[`Members API Can export CSV 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-disposition": Any, - "content-length": Any, - "content-type": "text/csv; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API Can export a filtered CSV 1: [body] 1`] = `Object {}`; - exports[`Members API Can export a filtered CSV 1: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", @@ -1309,19 +978,6 @@ Object { } `; -exports[`Members API Can export a filtered CSV 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-disposition": Any, - "content-length": "215", - "content-type": "text/csv; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - exports[`Members API Can fetch member counts stats 1: [body] 1`] = ` Object { "data": Array [ @@ -2319,1894 +1975,6 @@ Object { } `; -exports[`Members API with newsletters Add should fail when passing incorrect email_type query parameter 1: [body] 1`] = ` -Object { - "errors": Array [ - Object { - "code": null, - "context": "Validation (AllowedValues) failed for email_type", - "details": null, - "help": null, - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Validation error, cannot save member.", - "property": null, - "type": "ValidationError", - }, - ], -} -`; - -exports[`Members API with newsletters Add should fail when passing incorrect email_type query parameter 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "249", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can add 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "memberTestAdd@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "test", - "newsletters": Array [], - "note": "test note", - "products": Array [], - "status": "free", - "subscribed": false, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can add 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "625", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can add a subscription 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "paid", - "subscribed": true, - "subscriptions": Array [ - Object { - "cancel_at_period_end": false, - "cancellation_reason": null, - "current_period_end": Any, - "customer": Object { - "email": "member1@test.com", - "id": "cus_123", - "name": null, - }, - "default_payment_card_last4": null, - "id": "sub_123", - "offer": null, - "plan": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "month", - }, - "price": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "Monthly", - "price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "product": Object { - "id": "109c85c734fb9992e7bc30a26af66c22f5c94d8dc62e0a33cb797be902c06b2d", - "name": "Default Product", - "product_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - }, - "type": "recurring", - }, - "start_date": Any, - "status": "active", - }, - ], - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can add a subscription 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1408", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can add a subscription 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "paid", - "subscribed": true, - "subscriptions": Array [ - Object { - "cancel_at_period_end": false, - "cancellation_reason": null, - "current_period_end": Any, - "customer": Object { - "email": "member1@test.com", - "id": "cus_123", - "name": null, - }, - "default_payment_card_last4": null, - "id": "sub_123", - "offer": null, - "plan": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "month", - }, - "price": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "Monthly", - "price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "product": Object { - "id": "109c85c734fb9992e7bc30a26af66c22f5c94d8dc62e0a33cb797be902c06b2d", - "name": "Default Product", - "product_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - }, - "type": "recurring", - }, - "start_date": Any, - "status": "active", - }, - ], - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can add a subscription 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1408", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can add and send a signup confirmation email 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member_getting_confirmation@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Array [], - "last_seen_at": null, - "name": "Send Me Confirmation", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Array [], - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can add and send a signup confirmation email 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "494", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": Any, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can add and send a signup confirmation email 3: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can add complimentary subscription 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Name", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can add complimentary subscription 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "461", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can add complimentary subscription 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Name", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can add complimentary subscription 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "461", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can browse 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2@test.com", - "email_count": 0, - "email_open_rate": 50, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": null, - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Winston Zeddemore", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 8, - }, - }, -} -`; - -exports[`Members API with newsletters Can browse 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "8435", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can browse with filter 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API with newsletters Can browse with filter 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can browse with search 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API with newsletters Can browse with search 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can delete a member without cancelling Stripe Subscription 1: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can destroy 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "memberTestDestroy@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "test", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can destroy 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "468", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can destroy 3: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can destroy 4: [body] 1`] = ` -Object { - "errors": Array [ - Object { - "code": null, - "context": "Member not found.", - "details": null, - "help": null, - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Resource not found error, cannot read member.", - "property": null, - "type": "NotFoundError", - }, - ], -} -`; - -exports[`Members API with newsletters Can destroy 5: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "224", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can edit by id 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2Change@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "change me", - "newsletters": Array [], - "note": "initial note", - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can edit by id 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "479", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can edit by id 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "cantChangeMe@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "changed", - "newsletters": Array [], - "note": "edited note", - "products": Array [], - "status": "free", - "subscribed": false, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can edit by id 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "476", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can export CSV 1: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-disposition": Any, - "content-length": Any, - "content-type": "text/csv; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can export a filtered CSV 1: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-disposition": Any, - "content-length": "215", - "content-type": "text/csv; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can fetch member counts stats 1: [body] 1`] = ` -Object { - "data": Array [ - Object { - "comped": 0, - "date": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/, - "free": 2, - "paid": 1, - }, - ], - "resource": "members", - "total": 3, -} -`; - -exports[`Members API with newsletters Can fetch member counts stats 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "92", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can filter by paid status 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 5, - }, - }, -} -`; - -exports[`Members API with newsletters Can filter by paid status 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "6849", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can filter using contains operators 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API with newsletters Can filter using contains operators 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can ignore any unknown includes 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 5, - }, - }, -} -`; - -exports[`Members API with newsletters Can ignore any unknown includes 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "6849", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can order by email_open_rate 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2@test.com", - "email_count": 0, - "email_open_rate": 50, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": null, - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Winston Zeddemore", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 8, - }, - }, -} -`; - -exports[`Members API with newsletters Can order by email_open_rate 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": Any, - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can order by email_open_rate 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2@test.com", - "email_count": 0, - "email_open_rate": 50, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": null, - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Winston Zeddemore", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 8, - }, - }, -} -`; - -exports[`Members API with newsletters Can order by email_open_rate 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": Any, - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can read 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can read 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "607", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Can read and include email_recipients 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "email_recipients": Array [], - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API with newsletters Can read and include email_recipients 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "629", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Errors when fetching stats with unknown days param value 1: [body] 1`] = ` -Object { - "errors": Array [ - Object { - "code": null, - "context": "Validation (matches) failed for id undefined.id", - "details": null, - "help": null, - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Validation error, cannot read member.", - "property": null, - "type": "ValidationError", - }, - ], -} -`; - -exports[`Members API with newsletters Errors when fetching stats with unknown days param value 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "248", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Search by case-insensitive email MEMBER2 receives member with email member2@test.com 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2@test.com", - "email_count": 0, - "email_open_rate": 50, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": null, - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API with newsletters Search by case-insensitive email MEMBER2 receives member with email member2@test.com 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "528", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Search by case-insensitive name egg receives member with name Mr Egg 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API with newsletters Search by case-insensitive name egg receives member with name Mr Egg 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Search for non existing member returns empty result set 1: [body] 1`] = ` -Object { - "members": Array [], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 0, - }, - }, -} -`; - -exports[`Members API with newsletters Search for non existing member returns empty result set 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "102", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API with newsletters Search for paid members retrieves member with email paid@test.com 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Array [], - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API with newsletters Search for paid members retrieves member with email paid@test.com 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1699", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - exports[`Members API without Stripe Add should fail when comped flag is passed in but Stripe is not enabled 1: [body] 1`] = ` Object { "errors": Array [ @@ -4224,35 +1992,6 @@ Object { } `; -exports[`Members API without Stripe Add should fail when comped flag is passed in but Stripe is not enabled 1: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "376", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API without Stripe Add should fail when comped flag is passed in but Stripe is not enabled 2: [body] 1`] = ` -Object { - "errors": Array [ - Object { - "code": null, - "context": "Missing Stripe connection. Attempting to import members with Stripe data when there is no Stripe account connected.", - "details": null, - "help": "You need to connect to Stripe to import Stripe customers. ", - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Validation error, cannot save member.", - "property": "comped", - "type": "ValidationError", - }, - ], -} -`; - exports[`Members API without Stripe Add should fail when comped flag is passed in but Stripe is not enabled 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", @@ -4265,28 +2004,196 @@ Object { } `; -exports[`Members API: with multiple newsletters Add should fail when passing incorrect email_type query parameter 1: [body] 1`] = ` +exports[`Members API: wit multiple newsletters Can browse 1: [body] 1`] = ` Object { - "errors": Array [ + "members": Array [ Object { - "code": null, - "context": "Validation (AllowedValues) failed for email_type", - "details": null, - "help": null, - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Validation error, cannot save member.", - "property": null, - "type": "ValidationError", + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "member1@test.com", + "email_count": 0, + "email_open_rate": null, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Mr Egg", + "newsletters": Any, + "note": null, + "status": "free", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "member2@test.com", + "email_count": 0, + "email_open_rate": 50, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": null, + "newsletters": Any, + "note": null, + "status": "free", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "paid@test.com", + "email_count": 0, + "email_open_rate": 80, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Egon Spengler", + "newsletters": Any, + "note": null, + "status": "paid", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "trialing@test.com", + "email_count": 0, + "email_open_rate": null, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Ray Stantz", + "newsletters": Any, + "note": null, + "status": "paid", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "comped@test.com", + "email_count": 0, + "email_open_rate": null, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Vinz Clortho", + "newsletters": Any, + "note": null, + "status": "paid", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "vip@test.com", + "email_count": 0, + "email_open_rate": null, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Winston Zeddemore", + "newsletters": Any, + "note": null, + "status": "free", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "vip-paid@test.com", + "email_count": 0, + "email_open_rate": null, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Peter Venkman", + "newsletters": Any, + "note": null, + "status": "paid", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "with-product@test.com", + "email_count": 0, + "email_open_rate": null, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Dana Barrett", + "newsletters": Any, + "note": null, + "status": "paid", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, }, ], + "meta": Object { + "pagination": Object { + "limit": 15, + "next": null, + "page": 1, + "pages": 1, + "prev": null, + "total": 8, + }, + }, } `; -exports[`Members API: with multiple newsletters Add should fail when passing incorrect email_type query parameter 2: [headers] 1`] = ` +exports[`Members API: wit multiple newsletters Can browse 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "249", + "content-length": "8435", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "vary": "Origin, Accept-Encoding", @@ -4294,14 +2201,55 @@ Object { } `; -exports[`Members API: with multiple newsletters Can add 1: [body] 1`] = ` +exports[`Members API: wit multiple newsletters Can read 1: [body] 1`] = ` Object { "members": Array [ Object { "avatar_image": null, "comped": false, "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "memberTestAdd@test.com", + "email": "member1@test.com", + "email_count": 0, + "email_open_rate": null, + "email_opened_count": 0, + "geolocation": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "labels": Any, + "last_seen_at": null, + "name": "Mr Egg", + "newsletters": Any, + "note": null, + "products": Array [], + "status": "free", + "subscribed": true, + "subscriptions": Any, + "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, + }, + ], +} +`; + +exports[`Members API: wit multiple newsletters Can read 2: [headers] 1`] = ` +Object { + "access-control-allow-origin": "http://127.0.0.1:2369", + "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", + "content-length": "607", + "content-type": "application/json; charset=utf-8", + "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, + "vary": "Origin, Accept-Encoding", + "x-powered-by": "Express", +} +`; + +exports[`Members API: with multiple newsletters Can add with default newsletters 1: [body] 1`] = ` +Object { + "members": Array [ + Object { + "avatar_image": null, + "comped": false, + "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, + "email": "memberTestNewsletterAdd@test.com", "email_count": 0, "email_open_rate": null, "email_opened_count": 0, @@ -4310,7 +2258,34 @@ Object { "labels": Any, "last_seen_at": null, "name": "test", - "newsletters": Any, + "newsletters": Array [ + Object { + "default": false, + "description": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "name": "Daily newsletter", + "recipient_filter": "", + "sender_email": "jamie@example.com", + "sender_name": "Jamie", + "sender_reply_to": "jamie@example.com", + "sort_order": 0, + "status": "active", + "subscribe_on_signup": true, + }, + Object { + "default": false, + "description": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "name": "Weekly newsletter", + "recipient_filter": "", + "sender_email": "jamie@example.com", + "sender_name": "Jamie", + "sender_reply_to": "jamie@example.com", + "sort_order": 0, + "status": "active", + "subscribe_on_signup": true, + }, + ], "note": "test note", "products": Array [], "status": "free", @@ -4323,11 +2298,11 @@ Object { } `; -exports[`Members API: with multiple newsletters Can add 2: [headers] 1`] = ` +exports[`Members API: with multiple newsletters Can add with default newsletters 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "625", + "content-length": "1179", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, @@ -4336,14 +2311,14 @@ Object { } `; -exports[`Members API: with multiple newsletters Can add a subscription 1: [body] 1`] = ` +exports[`Members API: with multiple newsletters Can and and edit with custom newsletters 1: [body] 1`] = ` Object { "members": Array [ Object { "avatar_image": null, "comped": false, "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", + "email": "memberTestAddNewsletter2@test.com", "email_count": 0, "email_open_rate": null, "email_opened_count": 0, @@ -4351,220 +2326,26 @@ Object { "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, "labels": Any, "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "paid", - "subscribed": true, - "subscriptions": Array [ + "name": "test newsletter", + "newsletters": Array [ Object { - "cancel_at_period_end": false, - "cancellation_reason": null, - "current_period_end": Any, - "customer": Object { - "email": "member1@test.com", - "id": "cus_123", - "name": null, - }, - "default_payment_card_last4": null, - "id": "sub_123", - "offer": null, - "plan": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "month", - }, - "price": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "Monthly", - "price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "product": Object { - "id": "109c85c734fb9992e7bc30a26af66c22f5c94d8dc62e0a33cb797be902c06b2d", - "name": "Default Product", - "product_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - }, - "type": "recurring", - }, - "start_date": Any, + "default": false, + "description": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "name": "Weekly newsletter", + "recipient_filter": "", + "sender_email": "jamie@example.com", + "sender_name": "Jamie", + "sender_reply_to": "jamie@example.com", + "sort_order": 0, "status": "active", + "subscribe_on_signup": true, }, ], - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can add a subscription 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1408", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can add a subscription 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Array [], - "note": null, - "products": Array [], - "status": "paid", - "subscribed": true, - "subscriptions": Array [ - Object { - "cancel_at_period_end": false, - "cancellation_reason": null, - "current_period_end": Any, - "customer": Object { - "email": "member1@test.com", - "id": "cus_123", - "name": null, - }, - "default_payment_card_last4": null, - "id": "sub_123", - "offer": null, - "plan": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "month", - }, - "price": Object { - "amount": 5000, - "currency": "USD", - "id": "173e16a1fffa7d232b398e4a9b08d266a456ae8f3d23e5f11cc608ced6730b12", - "interval": "month", - "nickname": "Monthly", - "price_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "product": Object { - "id": "109c85c734fb9992e7bc30a26af66c22f5c94d8dc62e0a33cb797be902c06b2d", - "name": "Default Product", - "product_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - }, - "type": "recurring", - }, - "start_date": Any, - "status": "active", - }, - ], - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can add a subscription 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1408", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can add and send a signup confirmation email 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member_getting_confirmation@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Array [], - "last_seen_at": null, - "name": "Send Me Confirmation", - "newsletters": Array [], - "note": null, + "note": "test note", "products": Array [], "status": "free", - "subscribed": true, - "subscriptions": Array [], - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can add and send a signup confirmation email 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "494", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": Any, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can add and send a signup confirmation email 3: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can add complimentary subscription 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Name", - "newsletters": Any, - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, + "subscribed": false, "subscriptions": Any, "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, @@ -4573,11 +2354,11 @@ Object { } `; -exports[`Members API: with multiple newsletters Can add complimentary subscription 2: [headers] 1`] = ` +exports[`Members API: with multiple newsletters Can and and edit with custom newsletters 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "461", + "content-length": "919", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, @@ -4586,14 +2367,14 @@ Object { } `; -exports[`Members API: with multiple newsletters Can add complimentary subscription 3: [body] 1`] = ` +exports[`Members API: with multiple newsletters Can and and edit with custom newsletters 3: [body] 1`] = ` Object { "members": Array [ Object { "avatar_image": null, "comped": false, "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "compedtest@test.com", + "email": "memberTestAddNewsletter2@test.com", "email_count": 0, "email_open_rate": null, "email_opened_count": 0, @@ -4601,12 +2382,26 @@ Object { "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, "labels": Any, "last_seen_at": null, - "name": "Name", - "newsletters": Any, - "note": null, + "name": "test newsletter", + "newsletters": Array [ + Object { + "default": false, + "description": null, + "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, + "name": "Daily newsletter", + "recipient_filter": "", + "sender_email": "jamie@example.com", + "sender_name": "Jamie", + "sender_reply_to": "jamie@example.com", + "sort_order": 0, + "status": "active", + "subscribe_on_signup": true, + }, + ], + "note": "test note", "products": Array [], "status": "free", - "subscribed": true, + "subscribed": false, "subscriptions": Any, "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, @@ -4615,11 +2410,11 @@ Object { } `; -exports[`Members API: with multiple newsletters Can add complimentary subscription 4: [headers] 1`] = ` +exports[`Members API: with multiple newsletters Can and and edit with custom newsletters 4: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "461", + "content-length": "918", "content-type": "application/json; charset=utf-8", "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, "vary": "Origin, Accept-Encoding", @@ -4824,1045 +2619,6 @@ Object { } `; -exports[`Members API: with multiple newsletters Can browse with filter 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Can browse with filter 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can browse with search 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Can browse with search 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can delete a member without cancelling Stripe Subscription 1: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can destroy 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "memberTestDestroy@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "test", - "newsletters": Any, - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can destroy 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "468", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can destroy 3: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can destroy 4: [body] 1`] = ` -Object { - "errors": Array [ - Object { - "code": null, - "context": "Member not found.", - "details": null, - "help": null, - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Resource not found error, cannot read member.", - "property": null, - "type": "NotFoundError", - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can destroy 5: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "224", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can edit by id 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2Change@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "change me", - "newsletters": Any, - "note": "initial note", - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can edit by id 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "479", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "location": StringMatching /https\\?:\\\\/\\\\/\\.\\*\\?\\\\/members\\\\/\\[a-f0-9\\]\\{24\\}\\\\//, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can edit by id 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "cantChangeMe@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "changed", - "newsletters": Any, - "note": "edited note", - "products": Array [], - "status": "free", - "subscribed": false, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can edit by id 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "476", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can export CSV 1: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-disposition": Any, - "content-length": Any, - "content-type": "text/csv; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can export a filtered CSV 1: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-disposition": Any, - "content-length": "215", - "content-type": "text/csv; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can fetch member counts stats 1: [body] 1`] = ` -Object { - "data": Array [ - Object { - "comped": 0, - "date": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/, - "free": 2, - "paid": 1, - }, - ], - "resource": "members", - "total": 3, -} -`; - -exports[`Members API: with multiple newsletters Can fetch member counts stats 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "92", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can filter by paid status 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 5, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Can filter by paid status 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "6849", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can filter using contains operators 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Can filter using contains operators 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can ignore any unknown includes 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 5, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Can ignore any unknown includes 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "6849", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can order by email_open_rate 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2@test.com", - "email_count": 0, - "email_open_rate": 50, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": null, - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Winston Zeddemore", - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 8, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Can order by email_open_rate 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": Any, - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Can order by email_open_rate 3: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2@test.com", - "email_count": 0, - "email_open_rate": 50, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": null, - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "trialing@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Ray Stantz", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "comped@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Vinz Clortho", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Winston Zeddemore", - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "vip-paid@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Peter Venkman", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "with-product@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Dana Barrett", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 8, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Can order by email_open_rate 4: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": Any, - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - exports[`Members API: with multiple newsletters Can read 1: [body] 1`] = ` Object { "members": Array [ @@ -5903,252 +2659,3 @@ Object { "x-powered-by": "Express", } `; - -exports[`Members API: with multiple newsletters Can read and include email_recipients 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "email_recipients": Array [], - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Any, - "note": null, - "products": Array [], - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Can read and include email_recipients 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "629", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Errors when fetching stats with unknown days param value 1: [body] 1`] = ` -Object { - "errors": Array [ - Object { - "code": null, - "context": "Validation (matches) failed for id undefined.id", - "details": null, - "help": null, - "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Validation error, cannot read member.", - "property": null, - "type": "ValidationError", - }, - ], -} -`; - -exports[`Members API: with multiple newsletters Errors when fetching stats with unknown days param value 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "248", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Search by case-insensitive email MEMBER2 receives member with email member2@test.com 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member2@test.com", - "email_count": 0, - "email_open_rate": 50, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": null, - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Search by case-insensitive email MEMBER2 receives member with email member2@test.com 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "528", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Search by case-insensitive name egg receives member with name Mr Egg 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "member1@test.com", - "email_count": 0, - "email_open_rate": null, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Mr Egg", - "newsletters": Any, - "note": null, - "status": "free", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Search by case-insensitive name egg receives member with name Mr Egg 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "681", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Search for non existing member returns empty result set 1: [body] 1`] = ` -Object { - "members": Array [], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 0, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Search for non existing member returns empty result set 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "102", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; - -exports[`Members API: with multiple newsletters Search for paid members retrieves member with email paid@test.com 1: [body] 1`] = ` -Object { - "members": Array [ - Object { - "avatar_image": null, - "comped": false, - "created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "email": "paid@test.com", - "email_count": 0, - "email_open_rate": 80, - "email_opened_count": 0, - "geolocation": null, - "id": StringMatching /\\[a-f0-9\\]\\{24\\}/, - "labels": Any, - "last_seen_at": null, - "name": "Egon Spengler", - "newsletters": Any, - "note": null, - "status": "paid", - "subscribed": true, - "subscriptions": Any, - "updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, - "uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - }, - ], - "meta": Object { - "pagination": Object { - "limit": 15, - "next": null, - "page": 1, - "pages": 1, - "prev": null, - "total": 1, - }, - }, -} -`; - -exports[`Members API: with multiple newsletters Search for paid members retrieves member with email paid@test.com 2: [headers] 1`] = ` -Object { - "access-control-allow-origin": "http://127.0.0.1:2369", - "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "1699", - "content-type": "application/json; charset=utf-8", - "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, - "vary": "Origin, Accept-Encoding", - "x-powered-by": "Express", -} -`; diff --git a/test/e2e-api/admin/members.test.js b/test/e2e-api/admin/members.test.js index 4b34930319..1161cb7b93 100644 --- a/test/e2e-api/admin/members.test.js +++ b/test/e2e-api/admin/members.test.js @@ -322,7 +322,7 @@ describe('Members API', function () { memberId: newMember.id, asserts: [ { - from_status: null, + from_status: null, to_status: 'free' } ] @@ -590,7 +590,7 @@ describe('Members API', function () { } ] }; - + const {body} = await agent .post(`/members/`) .body({members: [initialMember]}) @@ -773,7 +773,7 @@ describe('Members API', function () { return [200, fakeSubscription]; } }); - + const initialMember = { name: fakeCustomer.name, email: fakeCustomer.email, @@ -896,7 +896,7 @@ describe('Members API', function () { return [200, fakeSubscription]; } }); - + const initialMember = { name: fakeCustomer.name, email: fakeCustomer.email, @@ -1290,12 +1290,11 @@ describe('Members API', function () { describe('Members API: with multiple newsletters', function () { before(async function () { agent = await agentProvider.getAdminAPIAgent(); - await fixtureManager.init('members'); + await fixtureManager.init('members', 'newsletters'); await agent.loginAsOwner(); }); beforeEach(function () { - mockManager.mockLabsEnabled('multipleProducts'); mockManager.mockLabsEnabled('multipleNewsletters'); mockManager.mockStripe(); mockManager.mockMail(); @@ -1318,147 +1317,6 @@ describe('Members API: with multiple newsletters', function () { etag: anyEtag }); }); - - it('Can browse with filter', async function () { - await agent - .get('/members/?filter=label:label-1') - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Can browse with search', async function () { - await agent - .get('/members/?search=member1') - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Can filter by paid status', async function () { - await agent - .get('/members/?filter=status:paid') - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(5).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Can filter using contains operators', async function () { - await agent - .get(`/members/?filter=name:~'Venkman'`) - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Can ignore any unknown includes', async function () { - await agent - .get('/members/?filter=status:paid&include=emailRecipients') - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(5).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Can order by email_open_rate', async function () { - await agent - .get('members/?order=email_open_rate%20desc') - .expectStatus(200) - .matchHeaderSnapshot({ - etag: anyEtag, - 'content-length': anyString - }) - .matchBodySnapshot({ - members: new Array(8).fill(memberMatcherShallowIncludesForNewsletters) - }) - .expect(({body}) => { - const {members} = body; - assert.equal(members[0].email_open_rate > members[1].email_open_rate, true, 'Expected the first member to have a greater open rate than the second.'); - }); - - await agent - .get('members/?order=email_open_rate%20asc') - .expectStatus(200) - .matchHeaderSnapshot({ - etag: anyEtag, - 'content-length': anyString - }) - .matchBodySnapshot({ - members: new Array(8).fill(memberMatcherShallowIncludesForNewsletters) - }) - .expect(({body}) => { - const {members} = body; - assert.equal(members[0].email_open_rate < members[1].email_open_rate, true, 'Expected the first member to have a smaller open rate than the second.'); - }); - }); - - it('Search by case-insensitive name egg receives member with name Mr Egg', async function () { - await agent - .get('members/?search=egg') - .expectStatus(200) - .matchBodySnapshot({ - members: [memberMatcherShallowIncludesForNewsletters] - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Search by case-insensitive email MEMBER2 receives member with email member2@test.com', async function () { - await agent - .get('members/?search=MEMBER2') - .expectStatus(200) - .matchBodySnapshot({ - members: [memberMatcherShallowIncludesForNewsletters] - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Search for paid members retrieves member with email paid@test.com', async function () { - await agent - .get('members/?search=egon&paid=true') - .expectStatus(200) - .matchBodySnapshot({ - members: [memberMatcherShallowIncludesForNewsletters] - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Search for non existing member returns empty result set', async function () { - await agent - .get('members/?search=do_not_exist') - .expectStatus(200) - .matchHeaderSnapshot({ - etag: anyEtag - }) - .matchBodySnapshot({ - members: [] - }); - }); - // Read a member it('Can read', async function () { @@ -1473,575 +1331,103 @@ describe('Members API: with multiple newsletters', function () { }); }); - it('Can read and include email_recipients', async function () { - await agent - .get(`/members/${testUtils.DataGenerator.Content.members[0].id}/?include=email_recipients`) - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - // Create a member - - it('Can add', async function () { + it('Can add with default newsletters', async function () { const member = { name: 'test', - email: 'memberTestAdd@test.com', + email: 'memberTestNewsletterAdd@test.com', note: 'test note', subscribed: false, labels: ['test-label'] }; + await agent + .post(`/members/`) + .body({members: [member]}) + .expectStatus(201) + .matchBodySnapshot({ + members: [{ + id: anyObjectId, + uuid: anyUuid, + created_at: anyISODateTime, + updated_at: anyISODateTime, + subscriptions: anyArray, + labels: anyArray, + newsletters: Array(2).fill({ + id: matchers.anyObjectId + }) + }] + }) + .matchHeaderSnapshot({ + etag: anyEtag, + location: anyLocationFor('members') + }); + }); + + // Edit a member + it('Can and and edit with custom newsletters', async function () { + // Add custom newsletter list to new member + const member = { + name: 'test newsletter', + email: 'memberTestAddNewsletter2@test.com', + note: 'test note', + subscribed: false, + labels: ['test-label'], + newsletters: [{id: testUtils.DataGenerator.Content.newsletters[1].id}] + }; + const {body} = await agent .post(`/members/`) .body({members: [member]}) .expectStatus(201) .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) + members: [{ + id: anyObjectId, + uuid: anyUuid, + created_at: anyISODateTime, + updated_at: anyISODateTime, + subscriptions: anyArray, + labels: anyArray, + newsletters: Array(1).fill({ + id: matchers.anyObjectId + }) + }] }) .matchHeaderSnapshot({ etag: anyEtag, location: anyLocationFor('members') }); - const newMember = body.members[0]; + const memberId = body.members[0].id; + const editedMember = { + newsletters: [{id: testUtils.DataGenerator.Content.newsletters[0].id}] + }; + + // Edit newsletter list for member + await agent + .put(`/members/${memberId}`) + .body({members: [editedMember]}) + .expectStatus(200) + .matchBodySnapshot({ + members: [{ + id: anyObjectId, + uuid: anyUuid, + created_at: anyISODateTime, + updated_at: anyISODateTime, + subscriptions: anyArray, + labels: anyArray, + newsletters: Array(1).fill({ + id: matchers.anyObjectId + }) + }] + }) + .matchHeaderSnapshot({ + etag: anyEtag + }); await agent .post(`/members/`) .body({members: [member]}) .expectStatus(422); - - await assertMemberEvents({ - eventType: 'MemberStatusEvent', - memberId: newMember.id, - asserts: [ - { - from_status: null, - to_status: 'free' - } - ] - }); - }); - - it('Can add and send a signup confirmation email', async function () { - const member = { - name: 'Send Me Confirmation', - email: 'member_getting_confirmation@test.com', - subscribed: true - }; - - const queryParams = { - send_email: true, - email_type: 'signup' - }; - - const {body} = await agent - .post('/members/?send_email=true&email_type=signup') - .body({members: [member]}) - .expectStatus(201) - .matchBodySnapshot({ - members: [memberMatcherNoIncludes] - }) - .matchHeaderSnapshot({ - etag: anyEtag, - location: anyString - }); - - const newMember = body.members[0]; - - mockManager.assert.sentEmail({ - subject: '🙌 Complete your sign up to Ghost!', - to: 'member_getting_confirmation@test.com' - }); - - await assertMemberEvents({ - eventType: 'MemberStatusEvent', - memberId: newMember.id, - asserts: [ - { - from_status: null, - to_status: 'free' - } - ] - }); - - await assertMemberEvents({ - eventType: 'MemberSubscribeEvent', - memberId: newMember.id, - asserts: [ - { - subscribed: true, - source: 'admin' - } - ] - }); - - // @TODO: do we really need to delete this member here? - await agent - .delete(`members/${body.members[0].id}/`) - .matchHeaderSnapshot({ - etag: anyEtag - }) - .expectStatus(204); - - const events = await models.MemberSubscribeEvent.findAll(); - assert.equal(events.models.length, 0, 'There should be no MemberSubscribeEvent remaining.'); - }); - - it('Add should fail when passing incorrect email_type query parameter', async function () { - const newMember = { - name: 'test', - email: 'memberTestAdd@test.com' - }; - - await agent - .post(`members/?send_email=true&email_type=lel`) - .body({members: [newMember]}) - .expectStatus(422) - .matchHeaderSnapshot({ - etag: anyEtag - }) - .matchBodySnapshot({ - errors: [{ - id: anyErrorId - }] - }); - - const statusEvents = await models.MemberStatusEvent.findAll(); - assert.equal(statusEvents.models.length, 1, 'No MemberStatusEvent should have been added after failing to create a subscription.'); - }); - - // Edit a member - - it('Can add complimentary subscription', async function () { - const stripeService = require('../../../core/server/services/stripe'); - const fakePrice = { - id: 'price_1', - product: '', - active: true, - nickname: 'Complimentary', - unit_amount: 0, - currency: 'USD', - type: 'recurring', - recurring: { - interval: 'year' - } - }; - const fakeSubscription = { - id: 'sub_1', - customer: 'cus_1', - status: 'active', - cancel_at_period_end: false, - metadata: {}, - current_period_end: Date.now() / 1000, - start_date: Date.now() / 1000, - plan: fakePrice, - items: { - data: [{ - price: fakePrice - }] - } - }; - sinon.stub(stripeService.api, 'createCustomer').callsFake(async function (data) { - return { - id: 'cus_1', - email: data.email - }; - }); - sinon.stub(stripeService.api, 'createPrice').resolves(fakePrice); - sinon.stub(stripeService.api, 'createSubscription').resolves(fakeSubscription); - sinon.stub(stripeService.api, 'getSubscription').resolves(fakeSubscription); - const initialMember = { - name: 'Name', - email: 'compedtest@test.com', - subscribed: true - }; - - const compedPayload = { - comped: true - }; - - const {body} = await agent - .post(`/members/`) - .body({members: [initialMember]}) - .expectStatus(201) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag, - location: anyLocationFor('members') - }); - - const newMember = body.members[0]; - - const {body: body2} = await agent - .put(`/members/${newMember.id}/`) - .body({members: [compedPayload]}) - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - - await assertMemberEvents({ - eventType: 'MemberStatusEvent', - memberId: newMember.id, - asserts: [ - { - from_status: null, - to_status: 'free' - } - ] - }); - - await assertMemberEvents({ - eventType: 'MemberSubscribeEvent', - memberId: newMember.id, - asserts: [ - { - subscribed: true, - source: 'admin' - } - ] - }); - }); - - it('Can edit by id', async function () { - const memberToChange = { - name: 'change me', - email: 'member2Change@test.com', - note: 'initial note', - subscribed: true - }; - - const memberChanged = { - name: 'changed', - email: 'cantChangeMe@test.com', - note: 'edited note', - subscribed: false - }; - - const {body} = await agent - .post(`/members/`) - .body({members: [memberToChange]}) - .expectStatus(201) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag, - location: anyLocationFor('members') - }); - const newMember = body.members[0]; - - await assertMemberEvents({ - eventType: 'MemberSubscribeEvent', - memberId: newMember.id, - asserts: [ - { - subscribed: true, - source: 'admin' - } - ] - }); - await assertMemberEvents({ - eventType: 'MemberStatusEvent', - memberId: newMember.id, - asserts: [ - { - from_status: null, - to_status: 'free' - } - ] - }); - - await agent - .put(`/members/${newMember.id}/`) - .body({members: [memberChanged]}) - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - - await assertMemberEvents({ - eventType: 'MemberEmailChangeEvent', - memberId: newMember.id, - asserts: [ - { - from_email: memberToChange.email, - to_email: memberChanged.email - } - ] - }); - await assertMemberEvents({ - eventType: 'MemberSubscribeEvent', - memberId: newMember.id, - asserts: [ - { - subscribed: true, - source: 'admin' - }, - { - subscribed: false, - source: 'admin' - } - ] - }); - }); - - it('Can add a subscription', async function () { - const memberId = testUtils.DataGenerator.Content.members[0].id; - const price = testUtils.DataGenerator.Content.stripe_prices[0]; - - function nockCallback(method, uri, body) { - const [match, resource, id] = uri.match(/\/?v1\/(\w+)(?:\/(\w+))?/) || [null]; - - if (!match) { - return [500]; - } - - if (resource === 'customers') { - return [200, {id: 'cus_123', email: 'member1@test.com'}]; - } - - if (resource === 'subscriptions') { - const now = Math.floor(Date.now() / 1000); - return [200, {id: 'sub_123', customer: 'cus_123', cancel_at_period_end: false, items: { - data: [{price: { - id: price.stripe_price_id, - recurring: { - interval: price.interval - }, - unit_amount: price.amount, - currency: price.currency.toLowerCase() - }}] - }, status: 'active', current_period_end: now + 24 * 3600, start_date: now}]; - } - } - - nock('https://api.stripe.com:443') - .persist() - .post(/v1\/.*/) - .reply((uri, body) => nockCallback('POST', uri, body)); - - nock('https://api.stripe.com:443') - .persist() - .get(/v1\/.*/) - .reply((uri, body) => nockCallback('GET', uri, body)); - - await agent - .post(`/members/${memberId}/subscriptions/`) - .body({ - stripe_price_id: price.id - }) - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill({ - id: anyObjectId, - uuid: anyUuid, - created_at: anyISODateTime, - updated_at: anyISODateTime, - labels: anyArray, - subscriptions: [{ - start_date: anyString, - current_period_end: anyString, - price: { - price_id: anyObjectId, - product: { - product_id: anyObjectId - } - } - }] - }) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - - // Check member read with a subscription - await agent - .get(`/members/${memberId}/`) - .expectStatus(200) - .matchBodySnapshot({ - members: new Array(1).fill({ - id: anyObjectId, - uuid: anyUuid, - created_at: anyISODateTime, - updated_at: anyISODateTime, - labels: anyArray, - subscriptions: [{ - start_date: anyString, - current_period_end: anyString, - price: { - price_id: anyObjectId, - product: { - product_id: anyObjectId - } - } - }] - }) - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - // Delete a member - - it('Can destroy', async function () { - const member = { - name: 'test', - email: 'memberTestDestroy@test.com' - }; - - const {body} = await agent - .post(`/members/`) - .body({members: [member]}) - .expectStatus(201) - .matchBodySnapshot({ - members: new Array(1).fill(memberMatcherShallowIncludesForNewsletters) - }) - .matchHeaderSnapshot({ - etag: anyEtag, - location: anyLocationFor('members') - }); - - const newMember = body.members[0]; - - await agent - .delete(`/members/${newMember.id}`) - .expectStatus(204) - .expectEmptyBody() - .matchHeaderSnapshot({ - etag: anyEtag - }); - - await agent - .get(`/members/${newMember.id}/`) - .expectStatus(404) - .matchBodySnapshot({ - errors: [{ - id: anyUuid - }] - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Can delete a member without cancelling Stripe Subscription', async function () { - let subscriptionCanceled = false; - nock('https://api.stripe.com') - .persist() - .delete(/v1\/.*/) - .reply((uri) => { - const [match, resource, id] = uri.match(/\/?v1\/(\w+)(?:\/(\w+))/) || [null]; - - if (match && resource === 'subscriptions') { - subscriptionCanceled = true; - return [200, { - id, - status: 'canceled' - }]; - } - - return [500]; - }); - - // @TODO This is wrong because it changes the state for the rest of the tests - // We need to add a member via a fixture and then remove them OR work out how - // to reapply fixtures before each test - const memberToDelete = fixtureManager.get('members', 2); - - await agent - .delete(`members/${memberToDelete.id}/`) - .expectStatus(204) - .expectEmptyBody() - .matchHeaderSnapshot({ - etag: anyEtag - }); - - assert.equal(subscriptionCanceled, false, 'expected subscription not to be canceled'); - }); - - // Export members to CSV - - it('Can export CSV', async function () { - const res = await agent - .get(`/members/upload/`) - .expectStatus(200) - .expectEmptyBody() // express-test body parsing doesn't support CSV - .matchHeaderSnapshot({ - etag: anyEtag, - 'content-length': anyString, //For some reason the content-length changes between 1220 and 1317 - 'content-disposition': anyString - }); - - res.text.should.match(/id,email,name,note,subscribed_to_emails,complimentary_plan,stripe_customer_id,created_at,deleted_at/); - - const csv = Papa.parse(res.text, {header: true}); - should.exist(csv.data.find(row => row.name === 'Mr Egg')); - should.exist(csv.data.find(row => row.name === 'Winston Zeddemore')); - should.exist(csv.data.find(row => row.name === 'Ray Stantz')); - should.exist(csv.data.find(row => row.email === 'member2@test.com')); - }); - - it('Can export a filtered CSV', async function () { - const res = await agent - .get(`/members/upload/?search=Egg`) - .expectStatus(200) - .expectEmptyBody() // express-test body parsing doesn't support CSV - .matchHeaderSnapshot({ - etag: anyEtag, - 'content-disposition': anyString - }); - - res.text.should.match(/id,email,name,note,subscribed_to_emails,complimentary_plan,stripe_customer_id,created_at,deleted_at/); - - const csv = Papa.parse(res.text, {header: true}); - should.exist(csv.data.find(row => row.name === 'Mr Egg')); - should.not.exist(csv.data.find(row => row.name === 'Egon Spengler')); - should.not.exist(csv.data.find(row => row.name === 'Ray Stantz')); - should.not.exist(csv.data.find(row => row.email === 'member2@test.com')); - }); - - // Get stats - - it('Can fetch member counts stats', async function () { - await agent - .get(`/members/stats/count/`) - .expectStatus(200) - .matchBodySnapshot({ - data: [{ - date: anyISODate - }] - }) - .matchHeaderSnapshot({ - etag: anyEtag - }); - }); - - it('Errors when fetching stats with unknown days param value', async function () { - await agent - .get('members/stats/?days=nope') - .expectStatus(422) - .matchHeaderSnapshot({ - etag: anyEtag - }) - .matchBodySnapshot({ - errors: [{ - id: anyErrorId - }] - }); }); }); diff --git a/test/unit/server/services/members/utils.test.js b/test/unit/server/services/members/utils.test.js new file mode 100644 index 0000000000..d8ac2077d8 --- /dev/null +++ b/test/unit/server/services/members/utils.test.js @@ -0,0 +1,106 @@ +const sinon = require('sinon'); +const should = require('should'); +const {formattedMemberResponse} = require('../../../../../core/server/services/members/utils'); +const labs = require('../../../../../core/shared/labs'); + +describe('Members Service - utils', function () { + describe('formattedMemberResponse', function () { + let labsStub; + beforeEach(function () { + labsStub = sinon.stub(labs, 'isSet').returns(true); + }); + + afterEach(function () { + sinon.restore(); + }); + + it('returns correct data', async function () { + const member1 = formattedMemberResponse({ + uuid: 'uuid-1', + email: 'jamie+1@example.com', + name: 'Jamie Larson', + avatar_image: 'https://gravatar.com/avatar/7d8efd2c2a781111599a8cae293cf704?s=250&d=blank', + subscribed: true, + status: 'free', + extra: 'property' + }); + should(member1).deepEqual({ + uuid: 'uuid-1', + email: 'jamie+1@example.com', + name: 'Jamie Larson', + firstname: 'Jamie', + avatar_image: 'https://gravatar.com/avatar/7d8efd2c2a781111599a8cae293cf704?s=250&d=blank', + subscribed: true, + subscriptions: [], + paid: false + }); + }); + + it('formats newsletter data', async function () { + const member1 = formattedMemberResponse({ + uuid: 'uuid-1', + email: 'jamie+1@example.com', + name: 'Jamie Larson', + avatar_image: 'https://gravatar.com/avatar/7d8efd2c2a781111599a8cae293cf704?s=250&d=blank', + subscribed: true, + status: 'comped', + extra: 'property', + newsletters: [{ + id: 'newsletter-1', + name: 'Daily brief', + description: 'One email daily', + sender_name: 'Jamie', + sender_email: 'jamie@example.com', + sort_order: 0 + }] + }); + should(member1).deepEqual({ + uuid: 'uuid-1', + email: 'jamie+1@example.com', + name: 'Jamie Larson', + firstname: 'Jamie', + avatar_image: 'https://gravatar.com/avatar/7d8efd2c2a781111599a8cae293cf704?s=250&d=blank', + subscribed: true, + subscriptions: [], + paid: true, + newsletters: [{ + id: 'newsletter-1', + name: 'Daily brief', + description: 'One email daily', + sort_order: 0 + }] + }); + }); + + it('removes newsletter data if flag is disabled', async function () { + labsStub.returns(false); + const member1 = formattedMemberResponse({ + uuid: 'uuid-1', + email: 'jamie+1@example.com', + name: 'Jamie Larson', + avatar_image: 'https://gravatar.com/avatar/7d8efd2c2a781111599a8cae293cf704?s=250&d=blank', + subscribed: true, + status: 'paid', + extra: 'property', + newsletters: [{ + id: 'newsletter-1', + name: 'Daily brief', + description: 'One email daily', + sender_name: 'Jamie', + sender_email: 'jamie@example.com', + sort_order: 0 + }] + }); + should(member1).deepEqual({ + uuid: 'uuid-1', + email: 'jamie+1@example.com', + name: 'Jamie Larson', + firstname: 'Jamie', + avatar_image: 'https://gravatar.com/avatar/7d8efd2c2a781111599a8cae293cf704?s=250&d=blank', + subscribed: true, + subscriptions: [], + paid: true + }); + }); + }); +}); diff --git a/test/unit/server/services/newsletters/index.test.js b/test/unit/server/services/newsletters/index.test.js new file mode 100644 index 0000000000..040a450bd3 --- /dev/null +++ b/test/unit/server/services/newsletters/index.test.js @@ -0,0 +1,43 @@ +const should = require('should'); +const sinon = require('sinon'); +const getNewslettersServiceInstance = require('../../../../../core/server/services/newsletters'); +const models = require('../../../../../core/server/models'); + +describe('Newsletters Service', function () { + before(function () { + models.init(); + }); + + afterEach(function () { + sinon.restore(); + }); + + describe('browse', function () { + it('lists all newsletters', async function () { + const findAllStub = { + toJSON: function () { + return [ + { + id: 'newsletter-1' + }, + { + id: 'newsletter-2' + } + ]; + } + }; + sinon.stub(models.Newsletter, 'findAll').returns(Promise.resolve(findAllStub)); + + const NewslettersService = getNewslettersServiceInstance({NewsletterModel: models.Newsletter}); + const newsletters = await NewslettersService.browse({}); + should(newsletters).deepEqual([ + { + id: 'newsletter-1' + }, + { + id: 'newsletter-2' + } + ]); + }); + }); +}); diff --git a/test/utils/fixture-utils.js b/test/utils/fixture-utils.js index d7daad919d..78886eb2da 100644 --- a/test/utils/fixture-utils.js +++ b/test/utils/fixture-utils.js @@ -577,6 +577,12 @@ const fixtures = { }); }, + insertNewsletters: async function insertNewsletters() { + return Promise.map(DataGenerator.forKnex.newsletters, function (newsletter) { + return models.Newsletter.add(newsletter, context.internal); + }); + }, + insertSnippets: function insertSnippets() { return Promise.map(DataGenerator.forKnex.snippets, function (snippet) { return models.Snippet.add(snippet, context.internal); @@ -630,6 +636,9 @@ const toDoList = { members: function insertMembersAndLabelsAndProducts() { return fixtures.insertMembersAndLabelsAndProducts(); }, + newsletters: function insertNewsletters() { + return fixtures.insertNewsletters(); + }, 'members:emails': function insertEmailsAndRecipients() { return fixtures.insertEmailsAndRecipients(); }, diff --git a/test/utils/fixtures/data-generator.js b/test/utils/fixtures/data-generator.js index 1a7b4d2084..efc49cfbef 100644 --- a/test/utils/fixtures/data-generator.js +++ b/test/utils/fixtures/data-generator.js @@ -365,6 +365,25 @@ DataGenerator.Content = { } ], + newsletters: [ + { + id: ObjectId().toHexString(), + name: 'Daily newsletter', + description: '', + sender_name: 'Jamie', + sender_email: 'jamie@example.com', + sender_reply_to: 'jamie@example.com' + }, + { + id: ObjectId().toHexString(), + name: 'Weekly newsletter', + description: '', + sender_name: 'Jamie', + sender_email: 'jamie@example.com', + sender_reply_to: 'jamie@example.com' + } + ], + products: [ { // No ID because these are in the core fixtures.json @@ -888,6 +907,23 @@ DataGenerator.forKnex = (function () { }; } + function createNewsletter(overrides) { + const newObj = _.cloneDeep(overrides); + + return _.defaults(newObj, { + id: ObjectId().toHexString(), + name: 'Daily Newsletter', + sender_name: 'Jamie Larsen', + sender_email: 'jamie@example.com', + sender_reply_to: 'jamie@example.com', + default: false, + status: 'active', + recipient_filter: '', + subscribe_on_signup: true, + sort_order: 0 + }); + } + function createMember(overrides) { const newObj = _.cloneDeep(overrides); @@ -1169,6 +1205,14 @@ DataGenerator.forKnex = (function () { } ]; + const members_newsletters = [ + { + id: ObjectId().toHexString(), + member_id: DataGenerator.Content.posts[0].id, + newsletter_id: DataGenerator.Content.tags[0].id + } + ]; + const posts_authors = [ { id: ObjectId().toHexString(), @@ -1280,6 +1324,11 @@ DataGenerator.forKnex = (function () { createMember(DataGenerator.Content.members[7]) ]; + const newsletters = [ + createNewsletter(DataGenerator.Content.newsletters[0]), + createNewsletter(DataGenerator.Content.newsletters[1]) + ]; + const labels = [ createLabel(DataGenerator.Content.labels[0]), createLabel(DataGenerator.Content.labels[2]) @@ -1369,6 +1418,7 @@ DataGenerator.forKnex = (function () { createEmail, createCustomThemeSetting: createBasic, createProduct, + createNewsletter, invites, posts, @@ -1376,6 +1426,7 @@ DataGenerator.forKnex = (function () { posts_meta, posts_tags, posts_authors, + members_newsletters, roles, users, roles_users, @@ -1388,6 +1439,7 @@ DataGenerator.forKnex = (function () { labels, members, products, + newsletters, members_labels, members_stripe_customers, stripe_customer_subscriptions, diff --git a/yarn.lock b/yarn.lock index b90901d154..f660b84ab3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2069,10 +2069,10 @@ "@tryghost/domain-events" "^0.1.9" "@tryghost/member-events" "^0.4.1" -"@tryghost/members-api@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-5.5.0.tgz#30bf580051f8ca69aa3c31515e83a4348af97f91" - integrity sha512-Mwlt3F/bFcGqnnJ9Y4fBkTiQS7tb1++puuO1fh35BNpOL5TuEdYF9kxjkODqnseEioaeWNxigsdx2yvvzgcwPA== +"@tryghost/members-api@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@tryghost/members-api/-/members-api-5.6.0.tgz#af84c73d273eb8321909ff23d457d1144916d838" + integrity sha512-XOn0eZVNy9IK7F9SkTTMyw59/iqYEsmRiAvZ6DPQbGL2O+FXIUdGnuGw1lJ2q33QWxBDpZ63oyj6rByVZiHu5A== dependencies: "@nexes/nql" "^0.6.0" "@tryghost/debug" "^0.1.2" @@ -2084,7 +2084,7 @@ "@tryghost/member-events" "^0.4.1" "@tryghost/members-analytics-ingress" "^0.1.12" "@tryghost/members-payments" "^0.1.11" - "@tryghost/members-stripe-service" "^0.9.3" + "@tryghost/members-stripe-service" "^0.9.4" "@tryghost/tpl" "^0.1.2" "@types/jsonwebtoken" "^8.5.1" bluebird "^3.5.4" @@ -2156,7 +2156,7 @@ jsonwebtoken "^8.5.1" lodash "^4.17.11" -"@tryghost/members-stripe-service@0.9.4", "@tryghost/members-stripe-service@^0.9.3": +"@tryghost/members-stripe-service@0.9.4", "@tryghost/members-stripe-service@^0.9.4": version "0.9.4" resolved "https://registry.yarnpkg.com/@tryghost/members-stripe-service/-/members-stripe-service-0.9.4.tgz#2e07cfa31dddba1d2bdde2d6b7449bc2c4bc6118" integrity sha512-22e7IlNx3D49YK4bdi3wknQ0Tz1nW9zqpq4MIlbLYjGeC8zBR1v1LSMG7NyQR8chErgp8u51xnC6YyQgDd9iAw==