Skip to content

Commit 2ae90c0

Browse files
committed
Updated test snapshots for comments default (TryGhost#27653)
ref TryGhost#27653 Comments are now enabled by default for new sites, so default email previews, email card rendering, settings responses, and Content API responses changed. Updating these snapshots keeps CI aligned with the new default.
1 parent 44d67fc commit 2ae90c0

7 files changed

Lines changed: 431 additions & 123 deletions

File tree

ghost/core/core/server/api/endpoints/utils/serializers/input/comments.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
module.exports = {
22
all(_apiConfig, frame) {
3-
// Map the 'liked' relation to 'count.liked'
4-
if (frame.options.withRelated && frame.options.withRelated.length > 0) {
5-
frame.options.withRelated = frame.options.withRelated.map((relation) => {
6-
if (relation === 'liked') {
7-
return 'count.liked';
8-
}
9-
if (relation === 'replies.liked') {
10-
return 'replies.count.liked';
11-
}
12-
return relation;
13-
});
3+
if (!frame.options.withRelated || frame.options.withRelated.length === 0) {
4+
return;
145
}
6+
7+
// Map the 'liked' relation to 'count.liked'
8+
frame.options.withRelated = frame.options.withRelated.map((relation) => {
9+
if (relation === 'liked') {
10+
return 'count.liked';
11+
}
12+
if (relation === 'replies.liked') {
13+
return 'replies.count.liked';
14+
}
15+
return relation;
16+
});
1517
},
1618

1719
browse(apiConfig, frame) {

ghost/core/test/e2e-api/admin/__snapshots__/email-previews.test.js.snap

Lines changed: 175 additions & 5 deletions
Large diffs are not rendered by default.

ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ Object {
314314
},
315315
Object {
316316
"key": "comments_enabled",
317-
"value": "off",
317+
"value": "all",
318318
},
319319
Object {
320320
"key": "outbound_link_tagging",
@@ -1205,7 +1205,7 @@ Object {
12051205
},
12061206
Object {
12071207
"key": "comments_enabled",
1208-
"value": "off",
1208+
"value": "all",
12091209
},
12101210
Object {
12111211
"key": "outbound_link_tagging",
@@ -1651,7 +1651,7 @@ Object {
16511651
},
16521652
Object {
16531653
"key": "comments_enabled",
1654-
"value": "off",
1654+
"value": "all",
16551655
},
16561656
Object {
16571657
"key": "outbound_link_tagging",
@@ -2142,7 +2142,7 @@ Object {
21422142
},
21432143
Object {
21442144
"key": "comments_enabled",
2145-
"value": "off",
2145+
"value": "all",
21462146
},
21472147
Object {
21482148
"key": "outbound_link_tagging",
@@ -2587,7 +2587,7 @@ Object {
25872587
},
25882588
Object {
25892589
"key": "comments_enabled",
2590-
"value": "off",
2590+
"value": "all",
25912591
},
25922592
Object {
25932593
"key": "outbound_link_tagging",
@@ -3515,7 +3515,7 @@ Object {
35153515
},
35163516
Object {
35173517
"key": "comments_enabled",
3518-
"value": "off",
3518+
"value": "all",
35193519
},
35203520
Object {
35213521
"key": "outbound_link_tagging",
@@ -3961,7 +3961,7 @@ Object {
39613961
},
39623962
Object {
39633963
"key": "comments_enabled",
3964-
"value": "off",
3964+
"value": "all",
39653965
},
39663966
Object {
39673967
"key": "outbound_link_tagging",
@@ -4407,7 +4407,7 @@ Object {
44074407
},
44084408
Object {
44094409
"key": "comments_enabled",
4410-
"value": "off",
4410+
"value": "all",
44114411
},
44124412
Object {
44134413
"key": "outbound_link_tagging",
@@ -4857,7 +4857,7 @@ Object {
48574857
},
48584858
Object {
48594859
"key": "comments_enabled",
4860-
"value": "off",
4860+
"value": "all",
48614861
},
48624862
Object {
48634863
"key": "outbound_link_tagging",
@@ -5302,7 +5302,7 @@ Object {
53025302
},
53035303
Object {
53045304
"key": "comments_enabled",
5305-
"value": "off",
5305+
"value": "all",
53065306
},
53075307
Object {
53085308
"key": "outbound_link_tagging",
@@ -5752,7 +5752,7 @@ Object {
57525752
},
57535753
Object {
57545754
"key": "comments_enabled",
5755-
"value": "off",
5755+
"value": "all",
57565756
},
57575757
Object {
57585758
"key": "outbound_link_tagging",
@@ -6586,7 +6586,7 @@ Object {
65866586
},
65876587
Object {
65886588
"key": "comments_enabled",
6589-
"value": "off",
6589+
"value": "all",
65906590
},
65916591
Object {
65926592
"key": "outbound_link_tagging",
@@ -7032,7 +7032,7 @@ Object {
70327032
},
70337033
Object {
70347034
"key": "comments_enabled",
7035-
"value": "off",
7035+
"value": "all",
70367036
},
70377037
Object {
70387038
"key": "outbound_link_tagging",
@@ -7479,7 +7479,7 @@ Object {
74797479
},
74807480
Object {
74817481
"key": "comments_enabled",
7482-
"value": "off",
7482+
"value": "all",
74837483
},
74847484
Object {
74857485
"key": "outbound_link_tagging",
@@ -7926,7 +7926,7 @@ Object {
79267926
},
79277927
Object {
79287928
"key": "comments_enabled",
7929-
"value": "off",
7929+
"value": "all",
79307930
},
79317931
Object {
79327932
"key": "outbound_link_tagging",
@@ -8435,7 +8435,7 @@ Object {
84358435
},
84368436
Object {
84378437
"key": "comments_enabled",
8438-
"value": "off",
8438+
"value": "all",
84398439
},
84408440
Object {
84418441
"key": "outbound_link_tagging",

ghost/core/test/e2e-api/content/__snapshots__/pages.test.js.snap

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Object {
99
"codeinjection_foot": null,
1010
"codeinjection_head": null,
1111
"comment_id": "618ba1ffbe2896088840a6e9",
12-
"comments": false,
12+
"comments": true,
1313
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
1414
"custom_excerpt": null,
1515
"custom_template": null,
@@ -49,7 +49,7 @@ exports[`Pages Content API Can request page 2: [headers] 1`] = `
4949
Object {
5050
"access-control-allow-origin": "*",
5151
"cache-control": "public, max-age=0",
52-
"content-length": "1119",
52+
"content-length": "1118",
5353
"content-type": "application/json; charset=utf-8",
5454
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
5555
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
@@ -77,7 +77,7 @@ Object {
7777
"codeinjection_foot": null,
7878
"codeinjection_head": null,
7979
"comment_id": "6194d3ce51e2700162531a78",
80-
"comments": false,
80+
"comments": true,
8181
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
8282
"custom_excerpt": null,
8383
"custom_template": null,
@@ -117,7 +117,7 @@ Tip: If you're reading any post or page on your site and you notice something yo
117117
"codeinjection_foot": null,
118118
"codeinjection_head": null,
119119
"comment_id": "6194d3ce51e2700162531a79",
120-
"comments": false,
120+
"comments": true,
121121
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
122122
"custom_excerpt": null,
123123
"custom_template": null,
@@ -162,7 +162,7 @@ If you prefer to use a contact form, almost all of the great embedded form servi
162162
"codeinjection_foot": null,
163163
"codeinjection_head": null,
164164
"comment_id": "6194d3ce51e2700162531a7b",
165-
"comments": false,
165+
"comments": true,
166166
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
167167
"custom_excerpt": null,
168168
"custom_template": null,
@@ -203,7 +203,7 @@ Ghost is a non-profit organization, and we give away all our intellectual proper
203203
"codeinjection_foot": null,
204204
"codeinjection_head": null,
205205
"comment_id": "6194d3ce51e2700162531a7a",
206-
"comments": false,
206+
"comments": true,
207207
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
208208
"custom_excerpt": null,
209209
"custom_template": null,
@@ -241,7 +241,7 @@ You can integrate any products, services, ads or integrations with Ghost yoursel
241241
"codeinjection_foot": null,
242242
"codeinjection_head": null,
243243
"comment_id": "618ba1ffbe2896088840a6e9",
244-
"comments": false,
244+
"comments": true,
245245
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
246246
"custom_excerpt": null,
247247
"custom_template": null,
@@ -281,7 +281,7 @@ exports[`Pages Content API Can request pages 2: [headers] 1`] = `
281281
Object {
282282
"access-control-allow-origin": "*",
283283
"cache-control": "public, max-age=0",
284-
"content-length": "9413",
284+
"content-length": "9408",
285285
"content-type": "application/json; charset=utf-8",
286286
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
287287
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
@@ -356,7 +356,7 @@ Object {
356356
"codeinjection_foot": null,
357357
"codeinjection_head": null,
358358
"comment_id": "6194d3ce51e2700162531a78",
359-
"comments": false,
359+
"comments": true,
360360
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
361361
"custom_excerpt": null,
362362
"custom_template": null,
@@ -395,7 +395,7 @@ Tip: If you're reading any post or page on your site and you notice something yo
395395
"codeinjection_foot": null,
396396
"codeinjection_head": null,
397397
"comment_id": "6194d3ce51e2700162531a79",
398-
"comments": false,
398+
"comments": true,
399399
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
400400
"custom_excerpt": null,
401401
"custom_template": null,
@@ -439,7 +439,7 @@ If you prefer to use a contact form, almost all of the great embedded form servi
439439
"codeinjection_foot": null,
440440
"codeinjection_head": null,
441441
"comment_id": "6194d3ce51e2700162531a7b",
442-
"comments": false,
442+
"comments": true,
443443
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
444444
"custom_excerpt": null,
445445
"custom_template": null,
@@ -479,7 +479,7 @@ Ghost is a non-profit organization, and we give away all our intellectual proper
479479
"codeinjection_foot": null,
480480
"codeinjection_head": null,
481481
"comment_id": "6194d3ce51e2700162531a7a",
482-
"comments": false,
482+
"comments": true,
483483
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
484484
"custom_excerpt": null,
485485
"custom_template": null,
@@ -516,7 +516,7 @@ You can integrate any products, services, ads or integrations with Ghost yoursel
516516
"codeinjection_foot": null,
517517
"codeinjection_head": null,
518518
"comment_id": "618ba1ffbe2896088840a6e9",
519-
"comments": false,
519+
"comments": true,
520520
"created_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000\\\\\\+\\\\d\\{2\\}:\\\\d\\{2\\}/,
521521
"custom_excerpt": null,
522522
"custom_template": null,

0 commit comments

Comments
 (0)