The patch looks like it is heading on the correct direction, we passed it through our test pipeline and all tests passed.
We found the same issues as Dave mentioned in his email, also after some code review we have the following questions/comments:
. Why does modify_animation.js have a dependency on sources/pgadmin if it doesnt use it?
. Can we convert modify_animation.js to ES6 without requirejs?
. Why does modifyAnimation function have 2 arguments if we never use the second one?
. Can we convert modify_animation_spec.js to ES6 without requirejs?
. Why is pgBrowser.tree.options function called 4 times in the tests?
As an aside, when you use toHaveBeenCalledWith it is redundant to expect on toHaveBeenCalled
. Looks like we are missing some coverage of the alertify modification as well
As an aside get_preferences, the "cache", is still broken, if the cache as no value it will retrieve it but returns undefined to the caller. This behavior need to be addressed. We should change get preferences to be a Promise based thing or else this might become a problem....
As another aside, one of our goals should be to move away from requirejs into a full ES6, webpack javascript build. In order to do that we should try to write the least amount of code possible using requirejs syntax. If we really need to write something in requirejs let it be a wrapper that call our ES6 function/class
Thanks
Joao