Skip to content

Commit

Permalink
Added email target option
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldlangeveld committed Feb 4, 2025
1 parent 12468ca commit e824d3d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/kg-default-nodes/test/nodes/call-to-action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,14 @@ describe('CallToActionNode', function () {
html.should.containEql('background-color: #F0F0F0');
html.should.containEql('Get access now');
html.should.containEql('http://someblog.com/somepost');
html.should.containEql('/content/images/2022/11/koenig-lexical.jpg');
html.should.containEql('This is a new CTA Card.'); // because hasImage is true
html.should.containEql('/content/images/2022/11/koenig-lexical.jpg');// because hasImage is true
html.should.containEql('This is a new CTA Card.');
html.should.containEql('Sponsored'); // because hasSponsorLabel is true
html.should.containEql('cta-card');
}));

it('has all data attributes in Email', editorTest(function () {
exportOptions.exportFormat = 'email';
exportOptions.target = 'email';
dataset = {
backgroundColor: 'green',
buttonColor: '#F0F0F0',
Expand All @@ -194,19 +195,19 @@ describe('CallToActionNode', function () {
imageUrl: '/content/images/2022/11/koenig-lexical.jpg',
layout: 'minimal',
showButton: true,
textValue: '<p><span style="white-space: pre-wrap;">This is a new CTA Card.</span></p>'
textValue: '<p><span style="white-space: pre-wrap;">This is a new CTA Card via email.</span></p>'
};
const callToActionNode = new CallToActionNode(dataset);
const {element} = callToActionNode.exportDOM(exportOptions);

const html = element.outerHTML.toString();
html.should.containEql('style="background-color: green;');
html.should.containEql('style="background-color: #F0F0F0;');
html.should.containEql('cta-card-email');
html.should.containEql('background-color: green');
html.should.containEql('background-color: #F0F0F0');
html.should.containEql('Get access now');
html.should.containEql('http://someblog.com/somepost');
html.should.containEql('/content/images/2022/11/koenig-lexical.jpg');
html.should.containEql('This is a new CTA Card.');
html.should.containEql('Sponsored');
html.should.containEql('/content/images/2022/11/koenig-lexical.jpg'); // because hasImage is true
html.should.containEql('This is a new CTA Card via email.');
}));
});

Expand Down

0 comments on commit e824d3d

Please sign in to comment.