mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Made tag snapshots more accurate in collections test suite
refs https://github.com/TryGhost/Arch/issues/46 - Allows to actually verify in the snapshot itself if the tag filter is working correctly or not.
This commit is contained in:
parent
3830401d55
commit
c4351456c6
2 changed files with 103 additions and 3 deletions
|
@ -211,7 +211,54 @@ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac tu
|
||||||
"reading_time": 1,
|
"reading_time": 1,
|
||||||
"slug": "ghostly-kitchen-sink",
|
"slug": "ghostly-kitchen-sink",
|
||||||
"status": "published",
|
"status": "published",
|
||||||
"tags": Any<Array>,
|
"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": "description",
|
||||||
|
"feature_image": "https://example.com/super_photo.jpg",
|
||||||
|
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||||
|
"meta_description": null,
|
||||||
|
"meta_title": null,
|
||||||
|
"name": "kitchen sink",
|
||||||
|
"og_description": null,
|
||||||
|
"og_image": null,
|
||||||
|
"og_title": null,
|
||||||
|
"slug": "kitchen-sink",
|
||||||
|
"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": "http://127.0.0.1:2369/tag/kitchen-sink/",
|
||||||
|
"visibility": "public",
|
||||||
|
},
|
||||||
|
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": "description",
|
||||||
|
"feature_image": null,
|
||||||
|
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||||
|
"meta_description": null,
|
||||||
|
"meta_title": null,
|
||||||
|
"name": "bacon",
|
||||||
|
"og_description": null,
|
||||||
|
"og_image": null,
|
||||||
|
"og_title": null,
|
||||||
|
"slug": "bacon",
|
||||||
|
"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": "http://127.0.0.1:2369/tag/bacon/",
|
||||||
|
"visibility": "public",
|
||||||
|
},
|
||||||
|
],
|
||||||
"tiers": Array [
|
"tiers": Array [
|
||||||
Object {
|
Object {
|
||||||
"active": true,
|
"active": true,
|
||||||
|
@ -298,7 +345,54 @@ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac tu
|
||||||
"reading_time": 1,
|
"reading_time": 1,
|
||||||
"slug": "html-ipsum",
|
"slug": "html-ipsum",
|
||||||
"status": "published",
|
"status": "published",
|
||||||
"tags": Any<Array>,
|
"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": "description",
|
||||||
|
"feature_image": "https://example.com/super_photo.jpg",
|
||||||
|
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||||
|
"meta_description": null,
|
||||||
|
"meta_title": null,
|
||||||
|
"name": "kitchen sink",
|
||||||
|
"og_description": null,
|
||||||
|
"og_image": null,
|
||||||
|
"og_title": null,
|
||||||
|
"slug": "kitchen-sink",
|
||||||
|
"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": "http://127.0.0.1:2369/tag/kitchen-sink/",
|
||||||
|
"visibility": "public",
|
||||||
|
},
|
||||||
|
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": "description",
|
||||||
|
"feature_image": null,
|
||||||
|
"id": StringMatching /\\[a-f0-9\\]\\{24\\}/,
|
||||||
|
"meta_description": null,
|
||||||
|
"meta_title": null,
|
||||||
|
"name": "bacon",
|
||||||
|
"og_description": null,
|
||||||
|
"og_image": null,
|
||||||
|
"og_title": null,
|
||||||
|
"slug": "bacon",
|
||||||
|
"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": "http://127.0.0.1:2369/tag/bacon/",
|
||||||
|
"visibility": "public",
|
||||||
|
},
|
||||||
|
],
|
||||||
"tiers": Array [
|
"tiers": Array [
|
||||||
Object {
|
Object {
|
||||||
"active": true,
|
"active": true,
|
||||||
|
|
|
@ -31,6 +31,12 @@ const tierSnapshot = {
|
||||||
updated_at: anyISODateTime
|
updated_at: anyISODateTime
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const tagSnapshotMatcher = {
|
||||||
|
id: anyObjectId,
|
||||||
|
created_at: anyISODateTime,
|
||||||
|
updated_at: anyISODateTime
|
||||||
|
};
|
||||||
|
|
||||||
const matchPostShallowIncludes = {
|
const matchPostShallowIncludes = {
|
||||||
id: anyObjectId,
|
id: anyObjectId,
|
||||||
uuid: anyUuid,
|
uuid: anyUuid,
|
||||||
|
@ -38,7 +44,7 @@ const matchPostShallowIncludes = {
|
||||||
url: anyString,
|
url: anyString,
|
||||||
authors: anyArray,
|
authors: anyArray,
|
||||||
primary_author: anyObject,
|
primary_author: anyObject,
|
||||||
tags: anyArray,
|
tags: Array(2).fill(tagSnapshotMatcher),
|
||||||
primary_tag: anyObject,
|
primary_tag: anyObject,
|
||||||
tiers: Array(2).fill(tierSnapshot),
|
tiers: Array(2).fill(tierSnapshot),
|
||||||
created_at: anyISODateTime,
|
created_at: anyISODateTime,
|
||||||
|
|
Loading…
Add table
Reference in a new issue