UNPKG

prodap-chatbot-domain

Version:

Classes utilizadas na resposta de todas as Intents do Assistente Virtual

107 lines 3.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.feedbackSelect = exports.feedbackSimple = void 0; const index_1 = require("../../../../index"); const MessageTypes_1 = require("../../../types/MessageTypes"); const feedbackSimple = () => { const result = new index_1.Dialog('Feedback'); result.add(new index_1.Feedback({ title: 'Essa informação foi útil para você?', category: 'card_bem_estar', period: 86400000, options: [ { text: '<#F44336>Não</#F44336>', value: -1, icon: { base64: 'any_icon_base64', color: '#F44336', height: 16, width: 18, }, backgroundColor: '#FEEDEB', type: index_1.FeedbackOptionsType.SIMPLE, finalMessage: { message: 'Obrigada! Sua opinião é muito importante e foi registrada!', buttonText: 'Fechar', }, }, { text: '<#4CAF50>Sim</#4CAF50>', value: 1, icon: { base64: 'any_icon_base64', color: '#4CAF50', height: 16, width: 18, }, backgroundColor: '#EAF6EA', type: index_1.FeedbackOptionsType.SIMPLE, finalMessage: { message: 'Obrigada! Sua opinião é muito importante e foi registrada!', buttonText: 'Fechar', }, }, ], })); expect(result.messages.length).toBe(1); const form = result.messages[0]; expect(form.type).toBe(MessageTypes_1.default.FORM); }; exports.feedbackSimple = feedbackSimple; const feedbackSelect = () => { const result = new index_1.Dialog('Feedback'); result.add(new index_1.Feedback({ title: 'Essa informação foi útil para você?', category: 'card_bem_estar', period: 86400000, options: [ { text: '<#F44336>Não</#F44336>', value: -1, icon: { base64: 'any_icon_base64', color: '#F44336', height: 16, width: 18, }, backgroundColor: '#FEEDEB', type: index_1.FeedbackOptionsType.SELECT, finalMessage: { message: 'Obrigada! Sua opinião é muito importante e foi registrada!', buttonText: 'Fechar', }, feedbackSelect: { title: 'Por qual motivo a informação não foi útil?', options: [ 'Informação incorreta', 'Informação insuficiente', 'Informação irrelevante', 'Outro motivo', ], }, }, { text: '<#4CAF50>Sim</#4CAF50>', value: 1, icon: { base64: 'any_icon_base64', color: '#4CAF50', height: 16, width: 18, }, backgroundColor: '#EAF6EA', type: index_1.FeedbackOptionsType.SIMPLE, finalMessage: { message: 'Obrigada! Sua opinião é muito importante e foi registrada!', buttonText: 'Fechar', }, }, ], })); expect(result.messages.length).toBe(1); const form = result.messages[0]; expect(form.type).toBe(MessageTypes_1.default.FORM); }; exports.feedbackSelect = feedbackSelect; //# sourceMappingURL=Feedback.js.map