Skip to content

Commit

Permalink
fixed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Jan 8, 2025
1 parent 6c2d570 commit 7edec63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/containers/HSM/HSM.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ describe('Add mode', () => {
});

fireEvent.click(screen.getByText('Add Variable'));
fireEvent.click(screen.getByText('Add buttons'));

fireEvent.change(screen.getByPlaceholderText('Button Title'), { target: { value: 'Call me' } });
fireEvent.change(screen.getByPlaceholderText('Button Value'), {
target: { value: '9876543210' },
});

await waitFor(() => {
expect(screen.getByText('Hi, How are you {{1}}')).toBeInTheDocument();
Expand Down
7 changes: 5 additions & 2 deletions src/mocks/Template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ export const templateMock = createTemplateMock({
languageId: '1',
example: 'Hi, How are you [User]',
shortcode: 'element_name',
hasButtons: true,
buttons: '[{"type":"PHONE_NUMBER","text":"Call me","phone_number":"9876543210"}]',
buttonType: 'CALL_TO_ACTION',
});

export const quickReplyMock = createTemplateMock({
Expand All @@ -295,7 +298,7 @@ export const quickReplyMock = createTemplateMock({
example: 'Hi',
shortcode: 'welcome',
hasButtons: true,
buttons: '[{"type":"QUICK_REPLY","text":""},{"type":"QUICK_REPLY","text":""}]',
buttons: '[{"type":"QUICK_REPLY","text":"Yes"},{"type":"QUICK_REPLY","text":"No"}]',
buttonType: 'QUICK_REPLY',
});

Expand All @@ -312,7 +315,7 @@ export const ctaMock = createTemplateMock({
example: 'Hi',
shortcode: 'welcome',
hasButtons: true,
buttons: '[{"type":"PHONE_NUMBER","text":"","phone_number":""}]',
buttons: '[{"type":"PHONE_NUMBER","text":"Call me","phone_number":"9876543210"}]',
buttonType: 'CALL_TO_ACTION',
});

Expand Down

0 comments on commit 7edec63

Please sign in to comment.