houdini icon indicating copy to clipboard operation
houdini copied to clipboard

[FEATURE] Add more tests to legacy_react/src/lib/utils.ts

Open faco400 opened this issue 3 years ago • 2 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 avatar Aug 02 '22 17:08 faco400

@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.

wwahammy avatar Aug 03 '22 18:08 wwahammy

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 image

faco400 avatar Aug 12 '22 00:08 faco400

@faco400 I do know the cause. It is fixed in https://github.com/houdiniproject/houdini/pull/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

wwahammy avatar Aug 12 '22 17:08 wwahammy

@faco400, #1314 is now merged.

wwahammy avatar Aug 12 '22 19:08 wwahammy

Got It! Thanks! @wwahammy

faco400 avatar Aug 12 '22 19:08 faco400