Skip to content

Commit

Permalink
test: add testcase for multiple handlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauravudia committed Feb 22, 2024
1 parent 84a4351 commit 9df68b4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,4 +504,12 @@ describe('generatePageCustomEventName', () => {
const result = generatePageCustomEventName(message, userDefinedEventTemplate);
expect(result).toBe(expected);
});

it('should return a custom event name when userDefinedEventTemplate contains multiple handlebar and message object is provided', () => {
const message = { name: 'Home', properties: { category: 'Index' } };
const userDefinedEventTemplate = 'Viewed a {{ properties.category }} {{ name }} page';
const expected = 'Viewed a Index Home page';
const result = generatePageCustomEventName(message, userDefinedEventTemplate);
expect(result).toBe(expected);
});
});

0 comments on commit 9df68b4

Please sign in to comment.