ifmeorg / ifme

Free, open source mental health communication web app to share experiences with loved ones
http://www.if-me.org/
GNU Affero General Public License v3.0
1.46k stars 734 forks source link

added tests for randomString and getPusher #2181

Closed saminarp closed 1 year ago

saminarp commented 1 year ago

Description

I have written unit tests for the client/app/utils. The coverage report for the index.js has gone up to 65% with the corresponding tests I have written in index.test.js

More Details

While I was able to cover all the lines for the function randomString, the functions setCsrfToken, getPusher uses DOM implementation which makes it very tricky to mock it in Jest. Thus, they remain uncovered.

Corresponding Issue

https://github.com/ifmeorg/ifme/issues/2128

Screenshots

CleanShot 2022-10-19 at 03 55 51@2x

Reviewing this pull request? Check out our Code Review Practices guide if you haven't already!

saminarp commented 1 year ago

Hi @julianguyen I've done the changes, please review ☺️

welcome[bot] commented 1 year ago

Thank you for merging this pull request with us! If you haven't already, in another pull request, please add yourself to our About page.