Switch all cases of window.location over to RB.navigateTo.
Review Request #12736 — Created Nov. 22, 2022 and submitted
navigateTomethod allows us to spy on things that would cause
the page to reload or navigate away during the test suite. We have a
couple cases of similar methods that were just part of other objects,
and a bunch of cases where we were assigning directly to
window.location. This change switches everything over to the new one.
reviewboard/static/rb/js/views/dummyReviewableView.es6.js (Diff revision 1)
Worth noting for here and other
replace()will replace the history entry, whereas
navigateTo()will append a history entry. Matters for the Back button, and what we want for switching tabs/views in the review UIs.
I'd suggest we augment
navigateTo()to take options and pass in a
replace: truefor these.
Revision 2 (+64 -100)
Checks run (2 succeeded)
Awesome, thank you for doing this!
reviewboard/static/rb/js/utils/urlUtils.es6.js (Diff revision 2)