diff --git a/tests/functional/reporting.js b/tests/functional/reporting.js index 347f1be19..67b0187c4 100644 --- a/tests/functional/reporting.js +++ b/tests/functional/reporting.js @@ -30,6 +30,17 @@ define([ }); }, + 'wyciwyg bug workaround': function() { + return this.remote + .setFindTimeout(intern.config.wc.pageLoadTimeout) + .get(require.toUrl(url + '?open=1&url=wyciwyg://0/http://bbs.csdn.net/topics/20282413')) + .findByCssSelector('#url').getProperty('value') + .then(function (value) { + assert.notInclude(value, 'wyciwyg://0/'); + }) + .end(); + }, + 'validation works': function() { return this.remote .setFindTimeout(intern.config.wc.pageLoadTimeout) diff --git a/webcompat/static/js/lib/bugform.js b/webcompat/static/js/lib/bugform.js index 14a5616da..47f5cd8d2 100644 --- a/webcompat/static/js/lib/bugform.js +++ b/webcompat/static/js/lib/bugform.js @@ -38,19 +38,19 @@ function BugForm() { var urlParam = location.search.match(/url=(.+)/); if (urlParam != null) { // weird Gecko bug. See https://bugzilla.mozilla.org/show_bug.cgi?id=1098037 - urlParam = self.trimWysiwyg(urlParam[1]); + urlParam = self.trimWyciwyg(urlParam[1]); urlField.val(decodeURIComponent(urlParam)); self.copyURL(); self.makeValid('url'); } }, - trimWysiwyg: function(url) { - //trim wysiwyg://N/ from URL. - var wysiwygRe = /(wysiwyg:\/\/\d+\/)/i; - if (url.search(wysiwygRe) !== 0) { + trimWyciwyg: function(url) { + //trim wyciwyg://N/ from URL. + var wyciwygRe = /(wyciwyg:\/\/\d+\/)/i; + if (url.search(wyciwygRe) !== 0) { return url; } else { - return url.replace(wysiwygRe, ''); + return url.replace(wyciwygRe, ''); } }, disableSubmits: function() {