diff options
author | Mike Greiling <mgreiling@gitlab.com> | 2017-06-13 18:20:26 +0300 |
---|---|---|
committer | Mike Greiling <mgreiling@gitlab.com> | 2017-06-13 18:20:26 +0300 |
commit | a526e619d96aa95a55110e540363c34ab782defc (patch) | |
tree | 09e41597fac96b94bcf2f7423811d34ca4997d92 /spec/javascripts/commits_spec.js | |
parent | f79caeaa454473802fe648f142bcf73684ffdbdc (diff) |
Revert "Merge branch 'karma-headless-chrome' into 'master'"
This reverts merge request !12036
Diffstat (limited to 'spec/javascripts/commits_spec.js')
-rw-r--r-- | spec/javascripts/commits_spec.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/javascripts/commits_spec.js b/spec/javascripts/commits_spec.js index ace95000468..44a4386b250 100644 --- a/spec/javascripts/commits_spec.js +++ b/spec/javascripts/commits_spec.js @@ -5,6 +5,15 @@ import '~/pager'; import '~/commits'; (() => { + // TODO: remove this hack! + // PhantomJS causes spyOn to panic because replaceState isn't "writable" + let phantomjs; + try { + phantomjs = !Object.getOwnPropertyDescriptor(window.history, 'replaceState').writable; + } catch (err) { + phantomjs = false; + } + describe('Commits List', () => { beforeEach(() => { setFixtures(` @@ -52,7 +61,9 @@ import '~/commits'; CommitsList.init(25); CommitsList.searchField.val(''); - spyOn(history, 'replaceState').and.stub(); + if (!phantomjs) { + spyOn(history, 'replaceState').and.stub(); + } ajaxSpy = spyOn(jQuery, 'ajax').and.callFake((req) => { req.success({ data: '<li>Result</li>', |