mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
* 🐛 Fixed API excerpt field issue ref https://github.com/TryGhost/Ghost/issues/10396 This fix now allows the API user to add field `excerpt` without the need for `plaintext` as format. Also added new tests for these functions. * Added new logic that takes `custom_excerpt` into account if all posts gets queried. * Removed limits in excerpt & plaintext post. * Updated snapshot.
190 lines
7.7 KiB
Text
190 lines
7.7 KiB
Text
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`post.* events post.added even is triggered 1: [body] 1`] = `
|
|
Object {
|
|
"post": Object {
|
|
"current": Object {
|
|
"canonical_url": null,
|
|
"codeinjection_foot": null,
|
|
"codeinjection_head": null,
|
|
"comment_id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
|
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
|
|
"custom_excerpt": null,
|
|
"custom_template": null,
|
|
"email": Object {},
|
|
"email_only": false,
|
|
"email_segment": "all",
|
|
"email_subject": null,
|
|
"excerpt": null,
|
|
"feature_image": null,
|
|
"feature_image_alt": null,
|
|
"feature_image_caption": null,
|
|
"featured": false,
|
|
"frontmatter": null,
|
|
"html": null,
|
|
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
|
"meta_description": null,
|
|
"meta_title": null,
|
|
"mobiledoc": "{\\"version\\":\\"0.3.1\\",\\"ghostVersion\\":\\"4.0\\",\\"markups\\":[],\\"atoms\\":[],\\"cards\\":[],\\"sections\\":[[1,\\"p\\",[[0,[],0,\\"\\"]]]]}",
|
|
"og_description": null,
|
|
"og_image": null,
|
|
"og_title": null,
|
|
"primary_tag": null,
|
|
"published_at": null,
|
|
"slug": "testing-post-added-webhook",
|
|
"status": "draft",
|
|
"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",
|
|
"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",
|
|
"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": "testing post.added 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 {},
|
|
},
|
|
}
|
|
`;
|
|
|
|
exports[`post.* events post.published even is triggered 1: [body] 1`] = `
|
|
Object {
|
|
"post": Object {
|
|
"current": Object {
|
|
"canonical_url": null,
|
|
"codeinjection_foot": null,
|
|
"codeinjection_head": null,
|
|
"comment_id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
|
"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": null,
|
|
"feature_image": null,
|
|
"feature_image_alt": null,
|
|
"feature_image_caption": null,
|
|
"featured": false,
|
|
"frontmatter": null,
|
|
"html": null,
|
|
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
|
"meta_description": null,
|
|
"meta_title": null,
|
|
"mobiledoc": "{\\"version\\":\\"0.3.1\\",\\"ghostVersion\\":\\"4.0\\",\\"markups\\":[],\\"atoms\\":[],\\"cards\\":[],\\"sections\\":[[1,\\"p\\",[[0,[],0,\\"\\"]]]]}",
|
|
"og_description": null,
|
|
"og_image": null,
|
|
"og_title": null,
|
|
"primary_tag": null,
|
|
"published_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
|
|
"slug": "webhookz",
|
|
"status": "published",
|
|
"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",
|
|
"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",
|
|
"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": "webhookz",
|
|
"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 {
|
|
"published_at": null,
|
|
"status": "draft",
|
|
"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",
|
|
"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",
|
|
"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,
|
|
},
|
|
],
|
|
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/,
|
|
},
|
|
},
|
|
}
|
|
`;
|