mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Merged v5.19.3 into main
v5.19.3
This commit is contained in:
commit
9b8c33484d
4 changed files with 68 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ghost-admin",
|
"name": "ghost-admin",
|
||||||
"version": "5.19.2",
|
"version": "5.19.3",
|
||||||
"description": "Ember.js admin client for Ghost",
|
"description": "Ember.js admin client for Ghost",
|
||||||
"author": "Ghost Foundation",
|
"author": "Ghost Foundation",
|
||||||
"homepage": "http://ghost.org",
|
"homepage": "http://ghost.org",
|
||||||
|
|
|
@ -231,7 +231,7 @@ const PostEmailSerializer = {
|
||||||
titleAlignment: newsletter.get('title_alignment'),
|
titleAlignment: newsletter.get('title_alignment'),
|
||||||
bodyFontCategory: newsletter.get('body_font_category'),
|
bodyFontCategory: newsletter.get('body_font_category'),
|
||||||
showBadge: newsletter.get('show_badge'),
|
showBadge: newsletter.get('show_badge'),
|
||||||
feedbackEnabled: newsletter.get('feedback_enabled'),
|
feedbackEnabled: newsletter.get('feedback_enabled') && labs.isSet('audienceFeedback'),
|
||||||
footerContent: newsletter.get('footer_content'),
|
footerContent: newsletter.get('footer_content'),
|
||||||
showHeaderName: newsletter.get('show_header_name'),
|
showHeaderName: newsletter.get('show_header_name'),
|
||||||
accentColor,
|
accentColor,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ghost",
|
"name": "ghost",
|
||||||
"version": "5.19.2",
|
"version": "5.19.3",
|
||||||
"description": "The professional publishing platform",
|
"description": "The professional publishing platform",
|
||||||
"author": "Ghost Foundation",
|
"author": "Ghost Foundation",
|
||||||
"homepage": "https://ghost.org",
|
"homepage": "https://ghost.org",
|
||||||
|
|
|
@ -385,7 +385,70 @@ describe('Post Email Serializer', function () {
|
||||||
assert(!output.html.includes('<!-- PAYWALL -->'));
|
assert(!output.html.includes('<!-- PAYWALL -->'));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should hide/show feedback buttons depending on feedback_enabled flag', async function () {
|
it('should hide feedback buttons and ignore feedback_enabled if alpha flag disabled', async function () {
|
||||||
|
sinon.stub(labs, 'isSet').returns(false);
|
||||||
|
sinon.stub(_PostEmailSerializer, 'serializePostModel').callsFake(async () => {
|
||||||
|
return {
|
||||||
|
url: 'https://testpost.com/',
|
||||||
|
title: 'This is a test',
|
||||||
|
excerpt: 'This is a test',
|
||||||
|
authors: 'This is a test',
|
||||||
|
feature_image_alt: 'This is a test',
|
||||||
|
feature_image_caption: 'This is a test',
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
|
mobiledoc: JSON.stringify({"version":"0.3.1","atoms":[],"cards":[],"markups":[],"sections":[[1,"p",[[0,[],0,"Free content only"]]]],"ghostVersion":"4.0"})
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const customSettings = {
|
||||||
|
accent_color: '#000099',
|
||||||
|
timezone: 'UTC'
|
||||||
|
};
|
||||||
|
|
||||||
|
const settingsMock = sinon.stub(settingsCache, 'get');
|
||||||
|
settingsMock.callsFake(function (key, options) {
|
||||||
|
if (customSettings[key]) {
|
||||||
|
return customSettings[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
return settingsMock.wrappedMethod.call(settingsCache, key, options);
|
||||||
|
});
|
||||||
|
const template = {
|
||||||
|
name: 'My newsletter',
|
||||||
|
header_image: '',
|
||||||
|
show_header_icon: true,
|
||||||
|
show_header_title: true,
|
||||||
|
show_feature_image: true,
|
||||||
|
title_font_category: 'sans-serif',
|
||||||
|
title_alignment: 'center',
|
||||||
|
body_font_category: 'serif',
|
||||||
|
show_badge: true,
|
||||||
|
show_header_name: true,
|
||||||
|
feedback_enabled: true,
|
||||||
|
footer_content: 'footer'
|
||||||
|
};
|
||||||
|
const newsletterMock = {
|
||||||
|
get: function (key) {
|
||||||
|
return template[key];
|
||||||
|
},
|
||||||
|
toJSON: function () {
|
||||||
|
return template;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const output = await serialize({}, newsletterMock, {isBrowserPreview: false});
|
||||||
|
assert(!output.html.includes('%{feedback_button_like}%'));
|
||||||
|
assert(!output.html.includes('%{feedback_button_dislike}%'));
|
||||||
|
|
||||||
|
template.feedback_enabled = true;
|
||||||
|
|
||||||
|
const outputWithButtons = await serialize({}, newsletterMock, {isBrowserPreview: false});
|
||||||
|
assert(!outputWithButtons.html.includes('%{feedback_button_like}%'));
|
||||||
|
assert(!outputWithButtons.html.includes('%{feedback_button_dislike}%'));
|
||||||
|
});
|
||||||
|
|
||||||
|
/*it('should hide/show feedback buttons depending on feedback_enabled flag', async function () {
|
||||||
|
sinon.stub(labs, 'isSet').returns(true);
|
||||||
sinon.stub(_PostEmailSerializer, 'serializePostModel').callsFake(async () => {
|
sinon.stub(_PostEmailSerializer, 'serializePostModel').callsFake(async () => {
|
||||||
return {
|
return {
|
||||||
url: 'https://testpost.com/',
|
url: 'https://testpost.com/',
|
||||||
|
@ -444,7 +507,7 @@ describe('Post Email Serializer', function () {
|
||||||
const outputWithButtons = await serialize({}, newsletterMock, {isBrowserPreview: false});
|
const outputWithButtons = await serialize({}, newsletterMock, {isBrowserPreview: false});
|
||||||
assert(outputWithButtons.html.includes('%{feedback_button_like}%'));
|
assert(outputWithButtons.html.includes('%{feedback_button_like}%'));
|
||||||
assert(outputWithButtons.html.includes('%{feedback_button_dislike}%'));
|
assert(outputWithButtons.html.includes('%{feedback_button_dislike}%'));
|
||||||
});
|
});*/
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('renderEmailForSegment', function () {
|
describe('renderEmailForSegment', function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue