tjtanjin / react-chatbotify

A modern React library for creating a flexible and extensible chatbot.
https://react-chatbotify.tjtanjin.com/
MIT License
103 stars 49 forks source link

[Task] Add test cases for sensitive text and markup language #59

Open tjtanjin opened 2 months ago

tjtanjin commented 2 months ago

Description: In v1.6.0, new features for handling sensitive input (sensitiveInput) and markup language (userBubble.dangerouslySetInnerHtml, botbubble.dangerousSetInnerHtml) have been added. It'll be great to add test cases to cover the following:

Similar approach can be referenced here: https://github.com/tjtanjin/react-chatbotify/issues/29

Note: The current testing approach is not ideal, as it does not allow for varying the initial configuration (e.g. testing with markup language enabled instead). This can be supported if the <ChatBot/> inside App.tsx is wrapped by the custom BotOptionsContext and then external buttons are provided for varying configurations (selenium webdriver would then be used to interact with these buttons). Good to explore this down the line.