backend-manager 5.9.7 → 5.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/src/cli/commands/setup-tests/bem-config.js +3 -2
- package/src/cli/commands/setup-tests/helpers.js +5 -0
- package/src/cli/commands/setup-tests/project-id-consistency.js +2 -1
- package/src/test/fixtures/firebase-project/.temp/test-mode.json +1 -1
- package/src/test/fixtures/firebase-project/database-debug.log +8 -8
- package/src/test/fixtures/firebase-project/firestore-debug.log +57 -55
- package/src/test/fixtures/firebase-project/pubsub-debug.log +3 -3
- package/templates/_.env +42 -0
- package/templates/_.gitignore +60 -0
- package/templates/backend-manager-config.json +249 -0
- package/templates/database.rules.json +83 -0
- package/templates/firebase.json +66 -0
- package/templates/firestore.indexes.json +4 -0
- package/templates/firestore.rules +112 -0
- package/templates/public/404.html +26 -0
- package/templates/public/index.html +24 -0
- package/templates/remoteconfig.template.json +1 -0
- package/templates/storage-lifecycle-config-1-day.json +9 -0
- package/templates/storage-lifecycle-config-30-days.json +9 -0
- package/templates/storage.rules +8 -0
- package/test/_init/accounts-validation.js +58 -0
- package/test/_legacy/ai/index.js +231 -0
- package/test/_legacy/ai/test.jpg +0 -0
- package/test/_legacy/ai/test.pdf +0 -0
- package/test/_legacy/index.js +31 -0
- package/test/_legacy/payment-resolver/chargebee/orders/refunded.json +0 -0
- package/test/_legacy/payment-resolver/chargebee/orders/unpaid.json +98 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/active.json +578 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-in-trial.json +38 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-skipped-to-active.json +135 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-active-to-cancelled.json +42 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-active.json +44 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-cancelled.json +39 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-refund.json +143 -0
- package/test/_legacy/payment-resolver/chargebee/subscriptions/trial-to-suspended.json +48 -0
- package/test/_legacy/payment-resolver/coinbase/orders/regular.json +204 -0
- package/test/_legacy/payment-resolver/coinbase/subscriptions/cancelled.json +204 -0
- package/test/_legacy/payment-resolver/coinbase/subscriptions/paid-2.json +125 -0
- package/test/_legacy/payment-resolver/index.js +1558 -0
- package/test/_legacy/payment-resolver/paypal/orders/refunded.json +0 -0
- package/test/_legacy/payment-resolver/paypal/orders/regular.json +120 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/active-refund-previous-stmnt.json +323 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/active.json +192 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-in-trial.json +125 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-payment-not-complete.json +76 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-payment-overdue-2.json +114 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-payment-overdue.json +114 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-active-to-cancelled.json +111 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-active.json +132 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-cancelled.json +107 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-expired.json +91 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-refund.json +147 -0
- package/test/_legacy/payment-resolver/paypal/subscriptions/trial-to-suspended.json +120 -0
- package/test/_legacy/payment-resolver/stripe/orders/refunded.json +0 -0
- package/test/_legacy/payment-resolver/stripe/orders/regular.json +91 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/active.json +421 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/trial-in-trial.json +349 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-active-failed-authorization.json +430 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-active.json +319 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-cancelled.json +319 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-refund.json +414 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/trial-to-suspended.json +319 -0
- package/test/_legacy/payment-resolver/stripe/subscriptions/unsure.json +339 -0
- package/test/_legacy/test-new +1178 -0
- package/test/_legacy/test.md +89 -0
- package/test/_legacy/usage.js +175 -0
- package/test/_legacy/user.js +31 -0
- package/test/ai/tools-live.js +170 -0
- package/test/boot/emulator-boots.js +37 -0
- package/test/content/blog-generate.js +160 -0
- package/test/email/campaign-send.js +45 -0
- package/test/email/consent-lifecycle.js +257 -0
- package/test/email/feedback-and-plain-send.js +52 -0
- package/test/email/fixtures/clean.json +30 -0
- package/test/email/fixtures/editorial.json +30 -0
- package/test/email/fixtures/field-report.json +53 -0
- package/test/email/marketing-lifecycle.js +132 -0
- package/test/email/newsletter-generate.js +819 -0
- package/test/email/newsletter-templates.js +491 -0
- package/test/email/templates.js +207 -0
- package/test/email/transactional-send.js +34 -0
- package/test/email/transactional.js +560 -0
- package/test/email/validation.js +710 -0
- package/test/events/auth-delete-race.js +201 -0
- package/test/events/payments/journey-payments-cancel-endpoint.js +100 -0
- package/test/events/payments/journey-payments-cancel.js +182 -0
- package/test/events/payments/journey-payments-discount.js +89 -0
- package/test/events/payments/journey-payments-failure.js +146 -0
- package/test/events/payments/journey-payments-legacy-product.js +149 -0
- package/test/events/payments/journey-payments-one-time-failure.js +111 -0
- package/test/events/payments/journey-payments-one-time.js +136 -0
- package/test/events/payments/journey-payments-plan-change.js +144 -0
- package/test/events/payments/journey-payments-refund-webhook.js +180 -0
- package/test/events/payments/journey-payments-suspend.js +181 -0
- package/test/events/payments/journey-payments-trial-cancel.js +130 -0
- package/test/events/payments/journey-payments-trial.js +171 -0
- package/test/events/payments/journey-payments-uid-resolution.js +132 -0
- package/test/events/payments/journey-payments-upgrade.js +135 -0
- package/test/fixtures/chargebee/invoice-one-time.json +27 -0
- package/test/fixtures/chargebee/subscription-active.json +44 -0
- package/test/fixtures/chargebee/subscription-cancelled.json +42 -0
- package/test/fixtures/chargebee/subscription-in-trial.json +41 -0
- package/test/fixtures/chargebee/subscription-legacy-plan.json +41 -0
- package/test/fixtures/chargebee/subscription-non-renewing.json +41 -0
- package/test/fixtures/chargebee/subscription-paused.json +42 -0
- package/test/fixtures/chargebee/webhook-payment-failed.json +51 -0
- package/test/fixtures/chargebee/webhook-subscription-created.json +47 -0
- package/test/fixtures/paypal/order-approved.json +62 -0
- package/test/fixtures/paypal/order-completed.json +110 -0
- package/test/fixtures/paypal/subscription-active.json +76 -0
- package/test/fixtures/paypal/subscription-cancelled.json +50 -0
- package/test/fixtures/paypal/subscription-suspended.json +65 -0
- package/test/fixtures/stripe/checkout-session-completed.json +130 -0
- package/test/fixtures/stripe/invoice-payment-failed.json +148 -0
- package/test/fixtures/stripe/invoice-subscription-payment-failed.json +28 -0
- package/test/fixtures/stripe/subscription-active.json +161 -0
- package/test/fixtures/stripe/subscription-canceled.json +161 -0
- package/test/fixtures/stripe/subscription-trialing.json +161 -0
- package/test/functions/admin/database-read.js +134 -0
- package/test/functions/admin/database-write.js +159 -0
- package/test/functions/admin/edit-post.js +366 -0
- package/test/functions/admin/firestore-query.js +207 -0
- package/test/functions/admin/firestore-read.js +129 -0
- package/test/functions/admin/firestore-write.js +105 -0
- package/test/functions/admin/get-stats.js +115 -0
- package/test/functions/admin/send-email.js +119 -0
- package/test/functions/admin/send-notification.js +208 -0
- package/test/functions/admin/write-repo-content.js +223 -0
- package/test/functions/general/add-marketing-contact.js +335 -0
- package/test/functions/general/fetch-post.js +54 -0
- package/test/functions/general/generate-uuid.js +114 -0
- package/test/functions/test/authenticate.js +64 -0
- package/test/functions/user/create-custom-token.js +73 -0
- package/test/functions/user/delete.js +135 -0
- package/test/functions/user/get-active-sessions.js +111 -0
- package/test/functions/user/get-subscription-info.js +99 -0
- package/test/functions/user/regenerate-api-keys.js +156 -0
- package/test/functions/user/resolve.js +52 -0
- package/test/functions/user/sign-out-all-sessions.js +94 -0
- package/test/functions/user/sign-up.js +252 -0
- package/test/functions/user/submit-feedback.js +104 -0
- package/test/functions/user/validate-settings.js +82 -0
- package/test/helpers/ai-request-payload.js +300 -0
- package/test/helpers/ai-test-provider.js +202 -0
- package/test/helpers/ai-tools-format.js +383 -0
- package/test/helpers/content/blog-auto-publisher.js +484 -0
- package/test/helpers/content/feed-parser.js +528 -0
- package/test/helpers/content/ghostii-blocks.js +134 -0
- package/test/helpers/content/ghostii-feed-integration.js +404 -0
- package/test/helpers/content/ghostii-write-article.js +243 -0
- package/test/helpers/environment.js +230 -0
- package/test/helpers/infer-contact.js +113 -0
- package/test/helpers/merge-line-files.js +271 -0
- package/test/helpers/payment/chargebee/parse-webhook.js +413 -0
- package/test/helpers/payment/chargebee/to-unified-one-time.js +147 -0
- package/test/helpers/payment/chargebee/to-unified-subscription.js +648 -0
- package/test/helpers/payment/paypal/parse-webhook.js +539 -0
- package/test/helpers/payment/paypal/to-unified-one-time.js +382 -0
- package/test/helpers/payment/paypal/to-unified-subscription.js +820 -0
- package/test/helpers/payment/stripe/parse-webhook.js +447 -0
- package/test/helpers/payment/stripe/to-unified-one-time.js +306 -0
- package/test/helpers/payment/stripe/to-unified-subscription.js +708 -0
- package/test/helpers/sanitize.js +222 -0
- package/test/helpers/slugify.js +394 -0
- package/test/helpers/storage.js +194 -0
- package/test/helpers/user.js +755 -0
- package/test/helpers/webhook-forward.js +418 -0
- package/test/mcp/discovery.js +53 -0
- package/test/mcp/oauth.js +161 -0
- package/test/mcp/protocol.js +268 -0
- package/test/mcp/roles.js +188 -0
- package/test/mcp/utils.js +245 -0
- package/test/routes/admin/create-post.js +364 -0
- package/test/routes/admin/database.js +131 -0
- package/test/routes/admin/deduplicate-image-alts.js +190 -0
- package/test/routes/admin/email.js +114 -0
- package/test/routes/admin/firestore-query.js +204 -0
- package/test/routes/admin/firestore.js +127 -0
- package/test/routes/admin/infer-contact.js +218 -0
- package/test/routes/admin/notification.js +198 -0
- package/test/routes/admin/post-resize-image.js +184 -0
- package/test/routes/admin/post.js +368 -0
- package/test/routes/admin/repo-content.js +223 -0
- package/test/routes/admin/stats.js +112 -0
- package/test/routes/content/post.js +54 -0
- package/test/routes/general/uuid.js +115 -0
- package/test/routes/marketing/campaign.js +125 -0
- package/test/routes/marketing/contact.js +370 -0
- package/test/routes/marketing/email-preferences.js +292 -0
- package/test/routes/marketing/push-send.js +32 -0
- package/test/routes/marketing/webhook-forward.js +61 -0
- package/test/routes/marketing/webhook.js +639 -0
- package/test/routes/payments/cancel.js +163 -0
- package/test/routes/payments/discount.js +80 -0
- package/test/routes/payments/dispute-alert.js +320 -0
- package/test/routes/payments/intent.js +336 -0
- package/test/routes/payments/portal.js +92 -0
- package/test/routes/payments/refund.js +179 -0
- package/test/routes/payments/trial-eligibility.js +71 -0
- package/test/routes/payments/webhook.js +107 -0
- package/test/routes/test/authenticate.js +59 -0
- package/test/routes/test/schema.js +554 -0
- package/test/routes/test/usage.js +342 -0
- package/test/routes/user/api-keys.js +156 -0
- package/test/routes/user/delete.js +136 -0
- package/test/routes/user/feedback.js +104 -0
- package/test/routes/user/sessions.js +199 -0
- package/test/routes/user/settings-validate.js +82 -0
- package/test/routes/user/signup.js +542 -0
- package/test/routes/user/subscription.js +99 -0
- package/test/routes/user/token.js +73 -0
- package/test/routes/user/user.js +157 -0
- package/test/rules/notifications.js +410 -0
- package/test/rules/payments-carts.js +371 -0
- package/test/rules/user.js +396 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test: GET /content/post
|
|
3
|
+
* Tests the content fetch post endpoint
|
|
4
|
+
* Fetches blog post content from GitHub
|
|
5
|
+
* Requires GitHub API key and repo_website config
|
|
6
|
+
*/
|
|
7
|
+
module.exports = {
|
|
8
|
+
description: 'General fetch post from GitHub',
|
|
9
|
+
type: 'group',
|
|
10
|
+
tests: [
|
|
11
|
+
// Test 1: Missing URL returns 400 error
|
|
12
|
+
{
|
|
13
|
+
name: 'missing-url-rejected',
|
|
14
|
+
auth: 'none',
|
|
15
|
+
timeout: 15000,
|
|
16
|
+
|
|
17
|
+
async run({ http, assert }) {
|
|
18
|
+
const response = await http.get('backend-manager/content/post', {});
|
|
19
|
+
|
|
20
|
+
assert.isError(response, 400, 'Missing URL should return 400');
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
// Test 2: Non-existent post returns 404
|
|
25
|
+
{
|
|
26
|
+
name: 'nonexistent-post-returns-404',
|
|
27
|
+
auth: 'none',
|
|
28
|
+
timeout: 30000,
|
|
29
|
+
|
|
30
|
+
async run({ http, assert }) {
|
|
31
|
+
const response = await http.get('backend-manager/content/post', {
|
|
32
|
+
url: 'https://example.com/blog/this-post-definitely-does-not-exist-12345',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
assert.isError(response, 404, 'Non-existent post should return 404');
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
// Test 3: Authenticated user fetching non-existent post returns 404
|
|
40
|
+
{
|
|
41
|
+
name: 'authenticated-nonexistent-returns-404',
|
|
42
|
+
auth: 'basic',
|
|
43
|
+
timeout: 30000,
|
|
44
|
+
|
|
45
|
+
async run({ http, assert }) {
|
|
46
|
+
const response = await http.get('backend-manager/content/post', {
|
|
47
|
+
url: 'https://example.com/blog/nonexistent-test-post-12345',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
assert.isError(response, 404, 'Non-existent post should return 404');
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test: UUID Route
|
|
3
|
+
* Tests the new RESTful UUID endpoint using proper HTTP verbs
|
|
4
|
+
*/
|
|
5
|
+
module.exports = {
|
|
6
|
+
description: 'UUID route',
|
|
7
|
+
type: 'group',
|
|
8
|
+
tests: [
|
|
9
|
+
{
|
|
10
|
+
name: 'v4-random-uuid',
|
|
11
|
+
auth: 'none',
|
|
12
|
+
timeout: 10000,
|
|
13
|
+
|
|
14
|
+
async run({ http, assert }) {
|
|
15
|
+
// POST /backend-manager/general/uuid
|
|
16
|
+
const response = await http.post('backend-manager/general/uuid', {
|
|
17
|
+
version: '4',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
assert.isSuccess(response, 'UUID v4 generation should succeed');
|
|
21
|
+
assert.hasProperty(response, 'data.uuid', 'Response should contain uuid');
|
|
22
|
+
assert.match(
|
|
23
|
+
response.data.uuid,
|
|
24
|
+
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,
|
|
25
|
+
'UUID v4 should have correct format'
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return { success: true };
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
name: 'v5-namespaced-uuid',
|
|
34
|
+
auth: 'none',
|
|
35
|
+
timeout: 10000,
|
|
36
|
+
|
|
37
|
+
async run({ http, assert }) {
|
|
38
|
+
const response = await http.post('backend-manager/general/uuid', {
|
|
39
|
+
version: '5',
|
|
40
|
+
name: 'test-name-for-uuid',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
assert.isSuccess(response, 'UUID v5 generation should succeed');
|
|
44
|
+
assert.hasProperty(response, 'data.uuid', 'Response should contain uuid');
|
|
45
|
+
assert.match(
|
|
46
|
+
response.data.uuid,
|
|
47
|
+
/^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,
|
|
48
|
+
'UUID v5 should have correct format'
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return { success: true };
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
name: 'v5-deterministic',
|
|
57
|
+
auth: 'none',
|
|
58
|
+
timeout: 10000,
|
|
59
|
+
|
|
60
|
+
async run({ http, assert }) {
|
|
61
|
+
const response1 = await http.post('backend-manager/general/uuid', {
|
|
62
|
+
version: '5',
|
|
63
|
+
name: 'test-name-for-uuid',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const response2 = await http.post('backend-manager/general/uuid', {
|
|
67
|
+
version: '5',
|
|
68
|
+
name: 'test-name-for-uuid',
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
assert.isSuccess(response1, 'First UUID v5 generation should succeed');
|
|
72
|
+
assert.isSuccess(response2, 'Second UUID v5 generation should succeed');
|
|
73
|
+
assert.equal(
|
|
74
|
+
response1.data.uuid,
|
|
75
|
+
response2.data.uuid,
|
|
76
|
+
'UUID v5 should be deterministic - same input should produce same output'
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return { success: true };
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
{
|
|
84
|
+
name: 'v5-requires-name',
|
|
85
|
+
auth: 'none',
|
|
86
|
+
timeout: 10000,
|
|
87
|
+
|
|
88
|
+
async run({ http, assert }) {
|
|
89
|
+
const response = await http.post('backend-manager/general/uuid', {
|
|
90
|
+
version: '5',
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
assert.isError(response, 400, 'UUID v5 without name should return 400');
|
|
94
|
+
|
|
95
|
+
return { success: true };
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
{
|
|
100
|
+
name: 'invalid-version-rejected',
|
|
101
|
+
auth: 'none',
|
|
102
|
+
timeout: 10000,
|
|
103
|
+
|
|
104
|
+
async run({ http, assert }) {
|
|
105
|
+
const response = await http.post('backend-manager/general/uuid', {
|
|
106
|
+
version: '99',
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
assert.isError(response, 400, 'Invalid version should return 400');
|
|
110
|
+
|
|
111
|
+
return { success: true };
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test: POST /marketing/campaign — Send a marketing campaign (Single Send)
|
|
3
|
+
*
|
|
4
|
+
* Normal mode: creates campaign doc in Firestore, verifies structure
|
|
5
|
+
* Extended mode (TEST_EXTENDED_MODE=true): sends a real test campaign via SendGrid/Beehiiv
|
|
6
|
+
* targeting the test_admin segment (hello@itwcreativeworks.com only)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
description: 'Marketing campaign (POST create + send)',
|
|
11
|
+
type: 'group',
|
|
12
|
+
tests: [
|
|
13
|
+
{
|
|
14
|
+
name: 'send-test-campaign',
|
|
15
|
+
auth: 'admin',
|
|
16
|
+
timeout: 60000,
|
|
17
|
+
skip: !process.env.TEST_EXTENDED_MODE
|
|
18
|
+
? 'TEST_EXTENDED_MODE not set (real provider send)'
|
|
19
|
+
: false,
|
|
20
|
+
|
|
21
|
+
async run({ http, assert, state }) {
|
|
22
|
+
const response = await http.post('backend-manager/marketing/campaign', {
|
|
23
|
+
name: 'BEM Test Campaign',
|
|
24
|
+
subject: 'Test Marketing Email',
|
|
25
|
+
content: '# Hello\n\nThis is a **test marketing email** sent from the BEM test suite.\n\nIf you received this, the SendGrid Single Send pipeline is working.',
|
|
26
|
+
test: true,
|
|
27
|
+
sendAt: 'now',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
assert.isSuccess(response, 'Campaign creation should succeed');
|
|
31
|
+
assert.hasProperty(response, 'data.id', 'Response should contain campaign ID');
|
|
32
|
+
assert.hasProperty(response, 'data.providers', 'Response should contain provider results');
|
|
33
|
+
|
|
34
|
+
const providers = response.data.providers || {};
|
|
35
|
+
|
|
36
|
+
console.log('Campaign results:', JSON.stringify(providers, null, 2));
|
|
37
|
+
|
|
38
|
+
if (providers.campaigns) {
|
|
39
|
+
state.sendgridId = providers.campaigns.id;
|
|
40
|
+
|
|
41
|
+
assert.propertyEquals(
|
|
42
|
+
response, 'data.providers.campaigns.success', true,
|
|
43
|
+
`SendGrid should succeed. Error: ${providers.campaigns.error || 'none'}`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (providers.newsletter) {
|
|
48
|
+
assert.hasProperty(response, 'data.providers.newsletter', 'Should have Beehiiv result');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
state.campaignId = response.data.id;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
async cleanup({ state }) {
|
|
55
|
+
if (state.campaignId) {
|
|
56
|
+
console.log(`Campaign ID: ${state.campaignId}`);
|
|
57
|
+
}
|
|
58
|
+
if (state.sendgridId) {
|
|
59
|
+
console.log(`SendGrid Single Send ID: ${state.sendgridId}`);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
{
|
|
65
|
+
name: 'create-future-campaign-is-pending',
|
|
66
|
+
auth: 'admin',
|
|
67
|
+
timeout: 30000,
|
|
68
|
+
|
|
69
|
+
async run({ http, assert, firestore }) {
|
|
70
|
+
// Future sendAt → campaign is saved as 'pending' for cron pickup, not sent immediately
|
|
71
|
+
const futureDate = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
72
|
+
|
|
73
|
+
const response = await http.post('backend-manager/marketing/campaign', {
|
|
74
|
+
name: 'Future Campaign',
|
|
75
|
+
subject: 'Future Subject',
|
|
76
|
+
content: 'Future content',
|
|
77
|
+
test: true,
|
|
78
|
+
sendAt: futureDate,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
assert.isSuccess(response, 'Future campaign creation should succeed');
|
|
82
|
+
assert.hasProperty(response, 'data.id', 'Response should contain campaign ID');
|
|
83
|
+
assert.propertyEquals(response, 'data.status', 'pending', 'Future campaign should be pending');
|
|
84
|
+
|
|
85
|
+
const doc = await firestore.get(`marketing-campaigns/${response.data.id}`);
|
|
86
|
+
assert.ok(doc, 'Campaign doc should exist in Firestore');
|
|
87
|
+
assert.equal(doc.status, 'pending', 'Firestore doc status should be pending');
|
|
88
|
+
assert.equal(doc.settings.name, 'Future Campaign', 'Name should match input');
|
|
89
|
+
assert.propertyEquals(response, 'data.providers', null, 'Future campaign should not have provider results');
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
{
|
|
94
|
+
name: 'campaign-requires-admin',
|
|
95
|
+
auth: 'user',
|
|
96
|
+
timeout: 15000,
|
|
97
|
+
|
|
98
|
+
async run({ http, assert }) {
|
|
99
|
+
const response = await http.post('backend-manager/marketing/campaign', {
|
|
100
|
+
name: 'Unauthorized Campaign',
|
|
101
|
+
subject: 'Should fail',
|
|
102
|
+
content: 'Should fail',
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
assert.isError(response, 403, 'Non-admin should get 403');
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
{
|
|
110
|
+
name: 'campaign-requires-auth',
|
|
111
|
+
auth: 'none',
|
|
112
|
+
timeout: 15000,
|
|
113
|
+
|
|
114
|
+
async run({ http, assert }) {
|
|
115
|
+
const response = await http.post('backend-manager/marketing/campaign', {
|
|
116
|
+
name: 'Unauthenticated Campaign',
|
|
117
|
+
subject: 'Should fail',
|
|
118
|
+
content: 'Should fail',
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
assert.isError(response, 401, 'Unauthenticated should get 401');
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
};
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test: POST /marketing/contact and DELETE /marketing/contact
|
|
3
|
+
* Tests the marketing contact endpoints for adding/removing users to SendGrid/Beehiiv
|
|
4
|
+
*
|
|
5
|
+
* Set TEST_EXTENDED_MODE=true to run tests against real SendGrid/Beehiiv APIs
|
|
6
|
+
* (requires SENDGRID_API_KEY and BEEHIIV_API_KEY env vars)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Test email patterns - look like real emails but +bem suffix identifies them for cleanup.
|
|
10
|
+
// Names should be inferred by AI from the email local part.
|
|
11
|
+
//
|
|
12
|
+
// Fixed test domain (`acme.com`) — deterministic across brands. Using the running brand's
|
|
13
|
+
// domain caused cross-brand state divergence in SendGrid/Beehiiv and non-deterministic
|
|
14
|
+
// company inference (different domain → different inferred company name).
|
|
15
|
+
//
|
|
16
|
+
// `valid`: use a name that won't be flagged as fictional/placeholder by the AI prompt.
|
|
17
|
+
// (The infer-contact prompt rejects fictional names — e.g. "rachel.greene" sometimes
|
|
18
|
+
// matches the Friends character and returns empty. Use a more anonymous name.)
|
|
19
|
+
//
|
|
20
|
+
// `invalid`: must reach the mailbox verification check (so previous checks all pass — must
|
|
21
|
+
// NOT start with "test"/"example" which are in BLOCKED_LOCAL_PATTERNS, NOT be on
|
|
22
|
+
// a corporate/disposable domain). Real-looking name on a real domain with no actual
|
|
23
|
+
// mailbox there is the safest pick.
|
|
24
|
+
const TEST_DOMAIN = 'acme.com';
|
|
25
|
+
const TEST_EMAILS = {
|
|
26
|
+
valid: () => `sarah.martinez+bem@${TEST_DOMAIN}`, // Should infer: Sarah Martinez
|
|
27
|
+
invalid: () => `nonexistent.user+bem@${TEST_DOMAIN}`, // No such mailbox — mailbox verification should flag as invalid
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
module.exports = {
|
|
31
|
+
description: 'Marketing contact (POST add + DELETE remove)',
|
|
32
|
+
type: 'group',
|
|
33
|
+
tests: [
|
|
34
|
+
// --- POST /marketing/contact tests ---
|
|
35
|
+
|
|
36
|
+
// Test 1: Admin can add valid email (with real provider calls if TEST_EXTENDED_MODE is set)
|
|
37
|
+
{
|
|
38
|
+
name: 'add-admin-valid-email-succeeds',
|
|
39
|
+
auth: 'admin',
|
|
40
|
+
timeout: 30000,
|
|
41
|
+
|
|
42
|
+
async run({ http, assert, state, config }) {
|
|
43
|
+
const testEmail = TEST_EMAILS.valid();
|
|
44
|
+
state.testEmail = testEmail;
|
|
45
|
+
|
|
46
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
47
|
+
email: testEmail,
|
|
48
|
+
source: 'bem-test',
|
|
49
|
+
// skipValidation bypasses the mailbox verification check — the test email
|
|
50
|
+
// doesn't have a real mailbox so the provider (correctly) marks it as not
|
|
51
|
+
// deliverable. We're testing the route flow, not the deliverability check itself.
|
|
52
|
+
skipValidation: true,
|
|
53
|
+
// No firstName/lastName - should be inferred as "Rachel Greene"
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
assert.isSuccess(response, 'Add marketing contact should succeed for admin');
|
|
57
|
+
assert.hasProperty(response, 'data.success', 'Response should contain success');
|
|
58
|
+
assert.propertyEquals(response, 'data.success', true, 'success should be true');
|
|
59
|
+
|
|
60
|
+
// Admin gets detailed response
|
|
61
|
+
assert.hasProperty(response, 'data.providers', 'Admin response should contain providers');
|
|
62
|
+
|
|
63
|
+
// If TEST_EXTENDED_MODE is set, verify provider results
|
|
64
|
+
if (process.env.TEST_EXTENDED_MODE) {
|
|
65
|
+
const providers = response.data.providers || {};
|
|
66
|
+
|
|
67
|
+
if (process.env.SENDGRID_API_KEY) {
|
|
68
|
+
assert.hasProperty(response, 'data.providers.campaigns', 'Should have SendGrid result');
|
|
69
|
+
if (providers.campaigns?.success) {
|
|
70
|
+
state.sendgridAdded = true;
|
|
71
|
+
} else {
|
|
72
|
+
// Log error for debugging but don't fail - could be list matching issue
|
|
73
|
+
console.log('SendGrid result:', providers.campaigns);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (process.env.BEEHIIV_API_KEY && config.marketing?.newsletter?.publicationId) {
|
|
78
|
+
assert.hasProperty(response, 'data.providers.newsletter', 'Should have Beehiiv result');
|
|
79
|
+
if (providers.newsletter?.success) {
|
|
80
|
+
state.beehiivAdded = true;
|
|
81
|
+
} else {
|
|
82
|
+
console.log('Beehiiv result:', providers.newsletter);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
async cleanup({ state, http }) {
|
|
89
|
+
// Only cleanup if TEST_EXTENDED_MODE is set and contacts were added
|
|
90
|
+
if (!process.env.TEST_EXTENDED_MODE || !state.testEmail) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
console.log(`Cleaning up test contact: ${state.testEmail}`);
|
|
95
|
+
|
|
96
|
+
const result = await http.delete('backend-manager/marketing/contact', {
|
|
97
|
+
email: state.testEmail,
|
|
98
|
+
});
|
|
99
|
+
console.log('Cleanup result:', result.data);
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
// Test 2: Invalid email format rejected
|
|
104
|
+
{
|
|
105
|
+
name: 'add-invalid-email-format-rejected',
|
|
106
|
+
auth: 'admin',
|
|
107
|
+
timeout: 15000,
|
|
108
|
+
|
|
109
|
+
async run({ http, assert }) {
|
|
110
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
111
|
+
email: 'not-a-valid-email',
|
|
112
|
+
source: 'bem-test',
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
assert.isError(response, 400, 'Invalid email format should return 400');
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
// Test 3: Missing email rejected
|
|
120
|
+
{
|
|
121
|
+
name: 'add-missing-email-rejected',
|
|
122
|
+
auth: 'admin',
|
|
123
|
+
timeout: 15000,
|
|
124
|
+
|
|
125
|
+
async run({ http, assert }) {
|
|
126
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
127
|
+
firstName: 'Test',
|
|
128
|
+
source: 'bem-test',
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
assert.isError(response, 400, 'Missing email should return 400');
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
// Test 4: Disposable email rejected
|
|
136
|
+
{
|
|
137
|
+
name: 'add-disposable-email-rejected',
|
|
138
|
+
auth: 'admin',
|
|
139
|
+
timeout: 15000,
|
|
140
|
+
|
|
141
|
+
async run({ http, assert }) {
|
|
142
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
143
|
+
email: 'test@mailinator.com',
|
|
144
|
+
source: 'bem-test',
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
assert.isError(response, 400, 'Disposable email should return 400');
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
// Test 5: Name inferred from email (AI only — requires extended mode)
|
|
152
|
+
{
|
|
153
|
+
name: 'add-name-inferred-from-email',
|
|
154
|
+
skip: !process.env.TEST_EXTENDED_MODE ? 'TEST_EXTENDED_MODE not set (AI inference requires OPENAI_API_KEY)' : false,
|
|
155
|
+
auth: 'admin',
|
|
156
|
+
timeout: 30000,
|
|
157
|
+
|
|
158
|
+
async run({ http, assert, state }) {
|
|
159
|
+
// Use valid email without providing name - should infer "Rachel Greene"
|
|
160
|
+
const testEmail = TEST_EMAILS.valid();
|
|
161
|
+
state.testEmail = testEmail;
|
|
162
|
+
|
|
163
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
164
|
+
email: testEmail,
|
|
165
|
+
source: 'bem-test',
|
|
166
|
+
// No firstName/lastName - should be inferred
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
assert.isSuccess(response, 'Add marketing contact should succeed');
|
|
170
|
+
|
|
171
|
+
// Check name was inferred
|
|
172
|
+
assert.hasProperty(response, 'data.nameInferred', 'Should have nameInferred');
|
|
173
|
+
assert.ok(
|
|
174
|
+
response.data.nameInferred.firstName || response.data.nameInferred.lastName,
|
|
175
|
+
'Name should be inferred from email'
|
|
176
|
+
);
|
|
177
|
+
assert.hasProperty(response.data.nameInferred, 'method', 'Should include inference method');
|
|
178
|
+
|
|
179
|
+
// Track if providers were called
|
|
180
|
+
if (process.env.TEST_EXTENDED_MODE) {
|
|
181
|
+
state.sendgridAdded = response.data?.providers?.campaigns?.success;
|
|
182
|
+
state.beehiivAdded = response.data?.providers?.newsletter?.success;
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
async cleanup({ state, http }) {
|
|
187
|
+
if (!process.env.TEST_EXTENDED_MODE || !state.testEmail) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
await http.delete('backend-manager/marketing/contact', { email: state.testEmail });
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
// Test 6: Admin can skip validation (use disposable domain but skip check)
|
|
196
|
+
{
|
|
197
|
+
name: 'add-admin-skip-validation',
|
|
198
|
+
auth: 'admin',
|
|
199
|
+
timeout: 30000,
|
|
200
|
+
|
|
201
|
+
async run({ http, assert, state }) {
|
|
202
|
+
// Use disposable domain - normally blocked, but skipValidation bypasses
|
|
203
|
+
const testEmail = 'rachel.greene+bem@mailinator.com';
|
|
204
|
+
state.testEmail = testEmail;
|
|
205
|
+
|
|
206
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
207
|
+
email: testEmail,
|
|
208
|
+
source: 'bem-test',
|
|
209
|
+
skipValidation: true,
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// Should succeed because validation was skipped
|
|
213
|
+
assert.isSuccess(response, 'Add marketing contact with skipValidation should succeed');
|
|
214
|
+
|
|
215
|
+
if (process.env.TEST_EXTENDED_MODE) {
|
|
216
|
+
state.sendgridAdded = response.data?.providers?.campaigns?.success;
|
|
217
|
+
state.beehiivAdded = response.data?.providers?.newsletter?.success;
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
async cleanup({ state, http }) {
|
|
222
|
+
if (!process.env.TEST_EXTENDED_MODE || !state.testEmail) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
await http.delete('backend-manager/marketing/contact', { email: state.testEmail });
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
// Test 7: Mailbox verification (only runs if TEST_EXTENDED_MODE and a mailbox API key are set)
|
|
231
|
+
{
|
|
232
|
+
name: 'add-mailbox-validation',
|
|
233
|
+
auth: 'admin',
|
|
234
|
+
timeout: 30000,
|
|
235
|
+
skip: !process.env.TEST_EXTENDED_MODE || !(process.env.NEVERBOUNCE_API_KEY || process.env.ZEROBOUNCE_API_KEY)
|
|
236
|
+
? 'TEST_EXTENDED_MODE or mailbox API key not set'
|
|
237
|
+
: false,
|
|
238
|
+
|
|
239
|
+
async run({ http, assert, state, skip }) {
|
|
240
|
+
const testEmail = TEST_EMAILS.valid();
|
|
241
|
+
state.testEmail = testEmail;
|
|
242
|
+
|
|
243
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
244
|
+
email: testEmail,
|
|
245
|
+
source: 'bem-test',
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
assert.isSuccess(response, 'Add marketing contact should succeed');
|
|
249
|
+
|
|
250
|
+
// Check that validation info is included
|
|
251
|
+
assert.hasProperty(response, 'data.validation', 'Response should contain validation');
|
|
252
|
+
assert.hasProperty(response, 'data.validation.checks', 'Validation should contain checks');
|
|
253
|
+
|
|
254
|
+
// Mailbox check should be in checks when key is set
|
|
255
|
+
assert.hasProperty(response, 'data.validation.checks.mailbox', 'Should have mailbox check');
|
|
256
|
+
|
|
257
|
+
const mbResult = response.data.validation.checks.mailbox;
|
|
258
|
+
|
|
259
|
+
// If out of credits, skip test - not a failure
|
|
260
|
+
if (mbResult.error?.includes('out of credits')) {
|
|
261
|
+
skip('Mailbox verification out of credits');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
assert.hasProperty(mbResult, 'status', 'Mailbox check should return status');
|
|
265
|
+
|
|
266
|
+
state.sendgridAdded = response.data?.providers?.campaigns?.success;
|
|
267
|
+
state.beehiivAdded = response.data?.providers?.newsletter?.success;
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
async cleanup({ state, http }) {
|
|
271
|
+
if (!state.testEmail) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
await http.delete('backend-manager/marketing/contact', { email: state.testEmail });
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
// Test 9: Mailbox verification rejects invalid email (only runs if TEST_EXTENDED_MODE and a mailbox API key are set)
|
|
280
|
+
{
|
|
281
|
+
name: 'add-mailbox-rejects-invalid',
|
|
282
|
+
auth: 'admin',
|
|
283
|
+
timeout: 30000,
|
|
284
|
+
skip: !process.env.TEST_EXTENDED_MODE || !(process.env.NEVERBOUNCE_API_KEY || process.env.ZEROBOUNCE_API_KEY)
|
|
285
|
+
? 'TEST_EXTENDED_MODE or mailbox API key not set'
|
|
286
|
+
: false,
|
|
287
|
+
|
|
288
|
+
async run({ http, assert, skip }) {
|
|
289
|
+
// Email that should reach the mailbox provider and be flagged as undeliverable.
|
|
290
|
+
// Must NOT trip earlier checks (localPart blocklist, disposable, corporate).
|
|
291
|
+
const testEmail = TEST_EMAILS.invalid();
|
|
292
|
+
|
|
293
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
294
|
+
email: testEmail,
|
|
295
|
+
source: 'bem-test',
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// With no ZeroBounce credits the route fails-open and returns 200; with credits
|
|
299
|
+
// the route should EITHER succeed (200) and report invalid in checks, OR error
|
|
300
|
+
// (400) with "Email validation failed". Either is correct behavior — what we
|
|
301
|
+
// verify here is that mailbox check ran and didn't mark the email as `valid`.
|
|
302
|
+
const mbResult = response.data?.validation?.checks?.mailbox;
|
|
303
|
+
|
|
304
|
+
// If credits are out, the test can't actually exercise rejection — skip.
|
|
305
|
+
if (mbResult?.error?.includes('out of credits') || mbResult?.error?.includes('Invalid API key')) {
|
|
306
|
+
skip('Mailbox verification out of credits');
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// If the response was a 400, that's the legitimate rejection path — done.
|
|
310
|
+
if (response.status === 400) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Otherwise expect a 200 with a non-"valid" mailbox status.
|
|
315
|
+
assert.isSuccess(response, 'Request should succeed (fail-open) or error 400');
|
|
316
|
+
if (mbResult) {
|
|
317
|
+
assert.hasProperty(mbResult, 'status', 'Should have status');
|
|
318
|
+
assert.notEqual(mbResult.status, 'valid', 'Fake email should not be marked valid');
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
// --- Auth rejection tests ---
|
|
324
|
+
{
|
|
325
|
+
name: 'add-unauthenticated-rejected',
|
|
326
|
+
auth: 'none',
|
|
327
|
+
timeout: 15000,
|
|
328
|
+
|
|
329
|
+
async run({ http, assert }) {
|
|
330
|
+
// Public request without auth must be rejected. The exact rejection mechanism
|
|
331
|
+
// depends on environment:
|
|
332
|
+
// - Production: missing reCAPTCHA token → 403
|
|
333
|
+
// - Local emulator (BEM_TESTING=true): reCAPTCHA is bypassed, but unauthenticated
|
|
334
|
+
// users hit the marketing-subscribe rate limit (quota 0/0) → 429
|
|
335
|
+
// Both are correct: the route protects itself from anonymous abuse. Accept either.
|
|
336
|
+
const response = await http.post('backend-manager/marketing/contact', {
|
|
337
|
+
email: TEST_EMAILS.valid(),
|
|
338
|
+
source: 'bem-test',
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
assert.ok(!response.success, 'Public request should be rejected');
|
|
342
|
+
assert.ok(
|
|
343
|
+
response.status === 403 || response.status === 429,
|
|
344
|
+
`Expected 403 or 429 but got ${response.status}`
|
|
345
|
+
);
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
// --- DELETE /marketing/contact tests ---
|
|
350
|
+
|
|
351
|
+
// Test: Final cleanup (runs last to clean up test contacts from providers)
|
|
352
|
+
{
|
|
353
|
+
name: 'delete-cleanup-test-contacts',
|
|
354
|
+
auth: 'admin',
|
|
355
|
+
timeout: 30000,
|
|
356
|
+
skip: !process.env.TEST_EXTENDED_MODE ? 'TEST_EXTENDED_MODE not set' : false,
|
|
357
|
+
|
|
358
|
+
async run({ http, assert }) {
|
|
359
|
+
// Clean up the rachel.greene+bem test contact from marketing providers
|
|
360
|
+
const testEmail = TEST_EMAILS.valid();
|
|
361
|
+
|
|
362
|
+
const response = await http.delete('backend-manager/marketing/contact', {
|
|
363
|
+
email: testEmail,
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
assert.isSuccess(response, 'Remove marketing contact should succeed');
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
};
|