-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added e2e tests for
post.tag.attached
webhook (#15576)
refs: #15537 - snapshot test created to add confidence to webhook stability and increase overall test coverage. Co-authored-by: Kritika Sharma <[email protected]>
- Loading branch information
1 parent
0bc31de
commit 2cb4282
Showing
2 changed files
with
357 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -649,3 +649,273 @@ Object { | |
}, | ||
} | ||
`; | ||
exports[`post.* events post.tag.attached event is triggered 1: [headers] 1`] = ` | ||
Object { | ||
"accept-encoding": "gzip, deflate", | ||
"content-length": Any<Number>, | ||
"content-type": "application/json", | ||
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, | ||
"user-agent": StringMatching /Ghost\\\\/\\\\d\\+\\\\\\.\\\\d\\+\\\\\\.\\\\d\\+\\\\s\\\\\\(https:\\\\/\\\\/github\\.com\\\\/TryGhost\\\\/Ghost\\\\\\)/, | ||
} | ||
`; | ||
exports[`post.* events post.tag.attached event is triggered 2: [body] 1`] = ` | ||
Object { | ||
"post": Object { | ||
"current": Object { | ||
"authors": Array [ | ||
Object { | ||
"accessibility": null, | ||
"bio": "bio", | ||
"comment_notifications": true, | ||
"cover_image": null, | ||
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"email": "[email protected]", | ||
"facebook": null, | ||
"free_member_signup_notification": true, | ||
"id": "1", | ||
"last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"location": "location", | ||
"meta_description": null, | ||
"meta_title": null, | ||
"name": "Joe Bloggs", | ||
"paid_subscription_canceled_notification": false, | ||
"paid_subscription_started_notification": true, | ||
"profile_image": "https://example.com/super_photo.jpg", | ||
"roles": Array [ | ||
Object { | ||
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"description": "Blog Owner", | ||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/, | ||
"name": "Owner", | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
}, | ||
], | ||
"slug": "joe-bloggs", | ||
"status": "active", | ||
"tour": null, | ||
"twitter": null, | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"url": "http://127.0.0.1:2369/author/joe-bloggs/", | ||
"website": null, | ||
}, | ||
], | ||
"canonical_url": null, | ||
"codeinjection_foot": null, | ||
"codeinjection_head": null, | ||
"comment_id": StringMatching /\\[a-f0-9\\]\\{24\\}/, | ||
"count": Object { | ||
"clicks": 0, | ||
"paid_conversions": 0, | ||
"positive_feedback": 0, | ||
"sentiment": 0, | ||
"signups": 0, | ||
}, | ||
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"custom_excerpt": null, | ||
"custom_template": null, | ||
"email_only": false, | ||
"email_segment": "all", | ||
"email_subject": null, | ||
"excerpt": "HTML Ipsum Presents | ||
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum o", | ||
"feature_image": null, | ||
"feature_image_alt": null, | ||
"feature_image_caption": null, | ||
"featured": false, | ||
"frontmatter": null, | ||
"html": "<!--kg-card-begin: markdown--><h1>HTML Ipsum Presents</h1><img src=\\"http://127.0.0.1:2369/content/images/lol.jpg\\"><p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href=\\\\\\"#\\\\\\">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p><h2>Header Level 2</h2><ol><li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li><li>Aliquam tincidunt mauris eu risus.</li></ol><blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.</p></blockquote><h3>Header Level 3</h3><ul><li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li><li>Aliquam tincidunt mauris eu risus.</li></ul><pre><code>#header h1 a{display: block;width: 300px;height: 80px;}</code></pre><!--kg-card-end: markdown-->", | ||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/, | ||
"meta_description": null, | ||
"meta_title": null, | ||
"mobiledoc": "{\\"version\\":\\"0.3.1\\",\\"markups\\":[],\\"atoms\\":[],\\"cards\\":[[\\"markdown\\",{\\"markdown\\":\\"<h1>HTML Ipsum Presents</h1><img src=\\\\\\"http://127.0.0.1:2369/content/images/lol.jpg\\\\\\"><p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href=\\\\\\\\\\\\\\"#\\\\\\\\\\\\\\">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p><h2>Header Level 2</h2><ol><li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li><li>Aliquam tincidunt mauris eu risus.</li></ol><blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.</p></blockquote><h3>Header Level 3</h3><ul><li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li><li>Aliquam tincidunt mauris eu risus.</li></ul><pre><code>#header h1 a{display: block;width: 300px;height: 80px;}</code></pre>\\"}]],\\"sections\\":[[10,0]]}", | ||
"og_description": null, | ||
"og_image": null, | ||
"og_title": null, | ||
"plaintext": "HTML Ipsum Presents | ||
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. | ||
Header Level 2 | ||
1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. | ||
2. Aliquam tincidunt mauris eu risus. | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est. | ||
Header Level 3 | ||
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit. | ||
* Aliquam tincidunt mauris eu risus. | ||
#header h1 a{display: block;width: 300px;height: 80px;}", | ||
"primary_author": Object { | ||
"accessibility": null, | ||
"bio": "bio", | ||
"comment_notifications": true, | ||
"cover_image": null, | ||
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"email": "[email protected]", | ||
"facebook": null, | ||
"free_member_signup_notification": true, | ||
"id": "1", | ||
"last_seen": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"location": "location", | ||
"meta_description": null, | ||
"meta_title": null, | ||
"name": "Joe Bloggs", | ||
"paid_subscription_canceled_notification": false, | ||
"paid_subscription_started_notification": true, | ||
"profile_image": "https://example.com/super_photo.jpg", | ||
"roles": Array [ | ||
Object { | ||
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"description": "Blog Owner", | ||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/, | ||
"name": "Owner", | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
}, | ||
], | ||
"slug": "joe-bloggs", | ||
"status": "active", | ||
"tour": null, | ||
"twitter": null, | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"url": "http://127.0.0.1:2369/author/joe-bloggs/", | ||
"website": null, | ||
}, | ||
"primary_tag": Object { | ||
"accent_color": null, | ||
"canonical_url": null, | ||
"codeinjection_foot": null, | ||
"codeinjection_head": null, | ||
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"description": null, | ||
"feature_image": null, | ||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/, | ||
"meta_description": null, | ||
"meta_title": null, | ||
"name": Any<String>, | ||
"og_description": null, | ||
"og_image": null, | ||
"og_title": null, | ||
"slug": Any<String>, | ||
"twitter_description": null, | ||
"twitter_image": null, | ||
"twitter_title": null, | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"url": StringMatching /http:\\\\/\\\\/127\\.0\\.0\\.1:2369\\\\/\\\\w\\+\\\\//, | ||
"visibility": Any<String>, | ||
}, | ||
"published_at": null, | ||
"reading_time": 1, | ||
"slug": "test-post-tag-attached-webhook", | ||
"status": "draft", | ||
"tags": Array [ | ||
Object { | ||
"accent_color": null, | ||
"canonical_url": null, | ||
"codeinjection_foot": null, | ||
"codeinjection_head": null, | ||
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"description": null, | ||
"feature_image": null, | ||
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/, | ||
"meta_description": null, | ||
"meta_title": null, | ||
"name": Any<String>, | ||
"og_description": null, | ||
"og_image": null, | ||
"og_title": null, | ||
"slug": Any<String>, | ||
"twitter_description": null, | ||
"twitter_image": null, | ||
"twitter_title": null, | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"url": StringMatching /http:\\\\/\\\\/127\\.0\\.0\\.1:2369\\\\/\\\\w\\+\\\\//, | ||
"visibility": Any<String>, | ||
}, | ||
], | ||
"tiers": 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": null, | ||
"name": "Default Product", | ||
"slug": "default-product", | ||
"trial_days": 0, | ||
"type": "paid", | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"visibility": "public", | ||
"welcome_page_url": null, | ||
"yearly_price_id": null, | ||
}, | ||
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": null, | ||
"name": "Free", | ||
"slug": "free", | ||
"trial_days": 0, | ||
"type": "free", | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"visibility": "public", | ||
"welcome_page_url": null, | ||
"yearly_price_id": null, | ||
}, | ||
], | ||
"title": "test post tag attached webhook", | ||
"twitter_description": null, | ||
"twitter_image": null, | ||
"twitter_title": null, | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"url": StringMatching /http:\\\\/\\\\/127\\.0\\.0\\.1:2369\\\\/\\\\w\\+\\\\//, | ||
"uuid": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, | ||
"visibility": "public", | ||
}, | ||
"previous": Object { | ||
"tags": Array [], | ||
"tiers": 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": null, | ||
"name": "Default Product", | ||
"slug": "default-product", | ||
"trial_days": 0, | ||
"type": "paid", | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"visibility": "public", | ||
"welcome_page_url": null, | ||
"yearly_price_id": null, | ||
}, | ||
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": null, | ||
"name": "Free", | ||
"slug": "free", | ||
"trial_days": 0, | ||
"type": "free", | ||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, | ||
"visibility": "public", | ||
"welcome_page_url": null, | ||
"yearly_price_id": null, | ||
}, | ||
], | ||
}, | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters