Fixed amp not rendering content

refs: 9d7049cd3

- I missed that the amp_content helper was meant to be async when refactoring
- I have updated our proper amp acceptance tests to catch the content not rendering as this is a regression, this should definitely have been caught
- Added missing async property to amp_content helper to fix the issue
This commit is contained in:
Hannah Wolfe 2021-10-05 12:27:31 +01:00
parent fd678ddae6
commit d724c8f95d
No known key found for this signature in database
GPG Key ID: 9F8C7532D0A6BA55
2 changed files with 5 additions and 1 deletions

View File

@ -201,3 +201,5 @@ function ampContent() {
}
module.exports = ampContent;
module.exports.async = true;

View File

@ -208,8 +208,10 @@ describe('Default Frontend routing', function () {
$('style[amp-custom]').length.should.equal(1);
res.text.should.containEql(':root {--ghost-accent-color: #FF1A75;}');
// This asserts we should have some content (and not [object Promise] !)
$('.post-content p').length.should.be.greaterThan(0);
res.text.should.containEql(':root {--ghost-accent-color: #FF1A75;}');
res.text.should.not.containEql('__GHOST_URL__');
});
});