mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added test illustrating filtering of null segments
refs https://github.com/TryGhost/Team/issues/861 - The test case illustrates that it's already possible to achieve what's described in the referenced issue (bug where the content is not filtered correctly when a single email segment card is present) - The bug fix for a general issue should be using this parser's ability to properly filter html/plaintext content
This commit is contained in:
parent
904a10a2ec
commit
b98854150c
1 changed files with 12 additions and 0 deletions
|
@ -68,5 +68,17 @@ describe('Post Email Serializer', function () {
|
|||
output.html.should.eql('hello<div> paid users!</div>');
|
||||
output.plaintext.should.eql('hello paid users!');
|
||||
});
|
||||
|
||||
it('should hide all segments when the segment filter is empty', function () {
|
||||
const email = {
|
||||
otherProperty: true,
|
||||
html: 'hello<div data-gh-segment="status:free"> free users!</div><div data-gh-segment="status:-free"> paid users!</div>',
|
||||
plaintext: 'test'
|
||||
};
|
||||
|
||||
let output = renderEmailForSegment(email, null);
|
||||
output.html.should.equal('hello');
|
||||
output.plaintext.should.equal('hello');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue