[FEATURE] Add more tests to legacy_react/src/lib/utils.ts
faco400 opened this issue · 5 comments
Is your feature request related to a problem? Please describe.
While working on the #1243 it was added a utils.specs.ts file containing unit tests for the removeChar function. But there are still other functions in the utils.ts that were not tested.
Describe the solution you'd like
Add more unit jest tests to the app/javascript/legacy_react/src/lib/utils.spec.ts file regarding the other functions in app/javascript/legacy_react/src/lib/utils.ts making sure everything is working correctly
@faco400 this is a good one! Some of the functions in legacy_react/src/lib/utils.ts
might be duplicates of function in other files, particularly app/javascript/legacy/common/utilities.ts
. If that's the case, please make sure the function is defined in only one of the files (you can import the function to reuse it in the other). Then put the jest tests next to the file where it's actually defined.
hi @wwahammy. Me @Rafaelltm @Carlacangussu were trying to run some tests but couldn't do it because we got an error. Its regarding another file using another module. We were wondering if you might know the problem
@faco400 I do know the cause. It is fixed in #1314. I will be merging it as soon as the build finishes.
As an FYI, please copy and paste output and code into issues. Screenshots aren't as convenient because I can't copy and paste from them. Please follow the instructions for quoting code and text as described in https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code