feat: Show the CSAT response to the agent (#2511)

This commit is contained in:
Pranav Raj S
2021-06-25 13:37:51 +05:30
committed by GitHub
parent b769fc87d0
commit bd1b17baf3
6 changed files with 74 additions and 12 deletions

View File

@@ -17,6 +17,30 @@ describe('#generateBotMessageContent', () => {
).toEqual('<strong>hello@chatwoot.com</strong>');
});
it('return correct input_csat content', () => {
expect(
generateBotMessageContent('input_csat', {
submitted_values: {
csat_survey_response: { rating: 5, feedback: 'Great Service' },
},
})
).toEqual(
'<div><strong>Rating</strong></div><p>😍</p><div><strong>Feedback</strong></div><p>Great Service</p>'
);
expect(
generateBotMessageContent(
'input_csat',
{
submitted_values: {
csat_survey_response: { rating: 1, feedback: '' },
},
},
{ csat: { ratingTitle: 'റേറ്റിംഗ്', feedbackTitle: 'പ്രതികരണം' } }
)
).toEqual('<div><strong>റേറ്റിംഗ്</strong></div><p>😞</p>');
});
it('return correct form content', () => {
expect(
generateBotMessageContent('form', {