tjtanjin / react-chatbotify

A modern React library for creating flexible and extensible chatbots.
https://react-chatbotify.com
MIT License
186 stars 100 forks source link

[Task] Add unit test cases for useSettingsInternal hook #131

Open tjtanjin opened 1 week ago

tjtanjin commented 1 week ago

Task Description: Currently, we run unit tests using jest which can be found here.

However, the test cases are not yet comprehensive enough and work can be done to cover more grounds. Specifically for this issue, we hope to add test cases for the useSettingsInternal hook.

Deliverable(s): New unit test cases that cover the testing of the useSettingsInternal hook.

Additional Context:

anandxs commented 1 week ago

I could not find the useSettingsInternal hook in the project. From what I understand, the useSettings hook directly accesses the settings and setSettings context and returns them.

tjtanjin commented 1 week ago

I could not find the useSettingsInternal hook in the project. From what I understand, the useSettings hook directly accesses the settings and setSettings context and returns them.

Hey @anandxs! Thank you for pointing it out and apologies for the confusion. You're right to observe that settings hook itself doesn't currently hold any internal logic. I'm contemplating adding a utility function to make updating of settings easier instead of having users directly deal with the setter. Let me ponder over this for a bit more - in the meantime, please feel free to look at other issues if you are keen 🥹