Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mgreiling@gitlab.com>2017-06-13 18:20:26 +0300
committerMike Greiling <mgreiling@gitlab.com>2017-06-13 18:20:26 +0300
commita526e619d96aa95a55110e540363c34ab782defc (patch)
tree09e41597fac96b94bcf2f7423811d34ca4997d92 /spec/javascripts/merge_request_tabs_spec.js
parentf79caeaa454473802fe648f142bcf73684ffdbdc (diff)
Revert "Merge branch 'karma-headless-chrome' into 'master'"
This reverts merge request !12036
Diffstat (limited to 'spec/javascripts/merge_request_tabs_spec.js')
-rw-r--r--spec/javascripts/merge_request_tabs_spec.js25
1 files changed, 19 insertions, 6 deletions
diff --git a/spec/javascripts/merge_request_tabs_spec.js b/spec/javascripts/merge_request_tabs_spec.js
index 9916d2c1e21..7b910282cc8 100644
--- a/spec/javascripts/merge_request_tabs_spec.js
+++ b/spec/javascripts/merge_request_tabs_spec.js
@@ -12,6 +12,15 @@ import '~/notes';
import 'vendor/jquery.scrollTo';
(function () {
+ // TODO: remove this hack!
+ // PhantomJS causes spyOn to panic because replaceState isn't "writable"
+ var phantomjs;
+ try {
+ phantomjs = !Object.getOwnPropertyDescriptor(window.history, 'replaceState').writable;
+ } catch (err) {
+ phantomjs = false;
+ }
+
describe('MergeRequestTabs', function () {
var stubLocation = {};
var setLocation = function (stubs) {
@@ -28,9 +37,11 @@ import 'vendor/jquery.scrollTo';
this.class = new gl.MergeRequestTabs({ stubLocation: stubLocation });
setLocation();
- this.spies = {
- history: spyOn(window.history, 'replaceState').and.callFake(function () {})
- };
+ if (!phantomjs) {
+ this.spies = {
+ history: spyOn(window.history, 'replaceState').and.callFake(function () {})
+ };
+ }
});
afterEach(function () {
@@ -197,9 +208,11 @@ import 'vendor/jquery.scrollTo';
pathname: '/foo/bar/merge_requests/1'
});
newState = this.subject('commits');
- expect(this.spies.history).toHaveBeenCalledWith({
- url: newState
- }, document.title, newState);
+ if (!phantomjs) {
+ expect(this.spies.history).toHaveBeenCalledWith({
+ url: newState
+ }, document.title, newState);
+ }
});
it('treats "show" like "notes"', function () {