Skip to content

Commit

Permalink
unit test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vgoodric committed Nov 8, 2024
1 parent a056337 commit e95bd5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/features/personalization/actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ describe('replace action with html/text instead of fragment', () => {
expect(primaryCTA.href).to.not.equal('updated text');
expect(secondaryCTA.innerText).to.not.equal('updated text');
expect(actionArea.innerHTML).to.not.equal('<p>updated text</p>');
config.placeholders = { 'marquee-href': 'https://test.com/updated_href' };

await init(mepSettings);
config.placeholders = null;

expect(header.innerText).to.equal('updated text');
expect(primaryCTA.innerText).to.equal('updated text');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"selector": ".marquee primary-cta #_href",
"page filter (optional)": "",
"param-newoffer=123": "",
"chrome": "https://test.com/updated_href",
"chrome": "{{marquee-href}}",
"target-var1": "",
"firefox": "",
"android": "",
Expand Down
2 changes: 2 additions & 0 deletions test/features/personalization/parseNestedPlaceholders.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ config.placeholders = {
'promo-discount': '50',
'promo-description': 'For just {{promo-price}}, get 20+...',
'promo-price': 'US$49.99',
'promo-href': 'https://www.adobe.com/',
};
config.locale = { region: 'US', ietf: 'en-US' };
describe('test different values for parseNestedPlaceholders', () => {
Expand Down Expand Up @@ -50,6 +51,7 @@ describe('replacePlaceholders()', () => {
});
it('should not break when there are no placeholders available', () => {
const str = 'For just {{promo-price}}, get 20+...';
config.placeholders = null;
const newStr = replacePlaceholders(str, null);
expect(newStr).to.equal(str);
});
Expand Down

0 comments on commit e95bd5c

Please sign in to comment.