react-chatbotify icon indicating copy to clipboard operation
react-chatbotify copied to clipboard

[Task] Add unit test cases for useSettingsInternal hook

Open tjtanjin opened this issue 1 year ago • 2 comments

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:

  • Hooks API can be found here
  • Existing unit test for hooks can be found here which may serve as a good source for reference.

tjtanjin avatar Oct 03 '24 16:10 tjtanjin

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.

anandxs avatar Oct 09 '24 07:10 anandxs

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 🥹

tjtanjin avatar Oct 10 '24 01:10 tjtanjin

Hey @anandxs, there's an internal hook for settings now. Let me know if you're still keen to work on it 😊

tjtanjin avatar Oct 18 '24 04:10 tjtanjin

Sure. I'd like to take it.

anandxs avatar Oct 18 '24 16:10 anandxs