mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Always use mockable location methods (#11929)
* Always use mockable location methods * Add eslint rules for window.location calls/assignment * Add useLocation hook * Update tests GitOrigin-RevId: eafb846db89f884a7a9a8570cce7745be605152c
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
// window location-related functions in a separate module so they can be mocked/stubbed in tests
|
||||
|
||||
export function reload() {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
export function assign(url) {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
window.location.assign(url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user