summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-03-30 13:06:17 -0500
committerMike Greiling <mike@pixelcog.com>2018-03-30 13:06:17 -0500
commit43fa85a45e9bcaa030d5b86ff50e89683a237f3d (patch)
tree7fd65e80ed739a74fde3ac87ea1db339d958df5c
parent3e23a0dd3648efdcef9edf6693b2eb379037058f (diff)
downloadgitlab-ce-30998-add-babel-rewire-plugin.tar.gz
throw errors when window location changes are performed in tests30998-add-babel-rewire-plugin
-rw-r--r--app/assets/javascripts/lib/utils/url_utility.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js
index a266bb6771f..ef522bc1369 100644
--- a/app/assets/javascripts/lib/utils/url_utility.js
+++ b/app/assets/javascripts/lib/utils/url_utility.js
@@ -65,6 +65,7 @@ export function getLocationHash(url = window.location.href) {
}
export function visitUrl(url, external = false) {
+ throw new Error('url_utility::visitUrl() should not be called in tests!');
if (external) {
// Simulate `target="blank" rel="noopener noreferrer"`
// See https://mathiasbynens.github.io/rel-noopener/
@@ -77,9 +78,11 @@ export function visitUrl(url, external = false) {
}
export function refreshCurrentPage() {
+ throw new Error('url_utility::refreshCurrentPate() should not be called in tests!');
visitUrl(window.location.href);
}
export function redirectTo(url) {
+ throw new Error('url_utility::redirectTo() should not be called in tests!');
return window.location.assign(url);
}