hubtype / botonic

Build chatbots and conversational experiences using React
https://botonic.io
MIT License
521 stars 76 forks source link

Botonic-React: change staticAsset function + add unit tests #2861

Closed AlbertGom closed 3 months ago

AlbertGom commented 3 months ago

Description

Changed how staticAsset function is searching for the script to resolve the assets path.

Context

The function is only searching for scripts that end with "webchat.botonic.js" so if the webchat file has another name it won't work.

Approach taken / Explain the design

Change the query done in the function to check that the script contains "webchat.botonic.js"

To document / Usage example

Testing

Added unit tests to test the function.