Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
037b0706
Commit
037b0706
authored
Jun 13, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove phantomjs-specific test hacks
parent
5c296cce
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
50 deletions
+10
-50
spec/javascripts/bootstrap_linked_tabs_spec.js
spec/javascripts/bootstrap_linked_tabs_spec.js
+2
-13
spec/javascripts/commits_spec.js
spec/javascripts/commits_spec.js
+1
-12
spec/javascripts/merge_request_tabs_spec.js
spec/javascripts/merge_request_tabs_spec.js
+6
-19
spec/javascripts/pipeline_schedules/interval_pattern_input_spec.js
...scripts/pipeline_schedules/interval_pattern_input_spec.js
+1
-1
spec/javascripts/pipelines_spec.js
spec/javascripts/pipelines_spec.js
+0
-5
No files found.
spec/javascripts/bootstrap_linked_tabs_spec.js
View file @
037b0706
import
LinkedTabs
from
'
~/lib/utils/bootstrap_linked_tabs
'
;
import
LinkedTabs
from
'
~/lib/utils/bootstrap_linked_tabs
'
;
(()
=>
{
(()
=>
{
// 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
(
'
Linked Tabs
'
,
()
=>
{
describe
(
'
Linked Tabs
'
,
()
=>
{
preloadFixtures
(
'
static/linked_tabs.html.raw
'
);
preloadFixtures
(
'
static/linked_tabs.html.raw
'
);
...
@@ -19,9 +10,7 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
...
@@ -19,9 +10,7 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
describe
(
'
when is initialized
'
,
()
=>
{
describe
(
'
when is initialized
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
if
(
!
phantomjs
)
{
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
callFake
(
function
()
{});
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
callFake
(
function
()
{});
}
});
});
it
(
'
should activate the tab correspondent to the given action
'
,
()
=>
{
it
(
'
should activate the tab correspondent to the given action
'
,
()
=>
{
...
@@ -47,7 +36,7 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
...
@@ -47,7 +36,7 @@ import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
describe
(
'
on click
'
,
()
=>
{
describe
(
'
on click
'
,
()
=>
{
it
(
'
should change the url according to the clicked tab
'
,
()
=>
{
it
(
'
should change the url according to the clicked tab
'
,
()
=>
{
const
historySpy
=
!
phantomjs
&&
spyOn
(
history
,
'
replaceState
'
).
and
.
callFake
(()
=>
{});
const
historySpy
=
spyOn
(
history
,
'
replaceState
'
).
and
.
callFake
(()
=>
{});
const
linkedTabs
=
new
LinkedTabs
({
const
linkedTabs
=
new
LinkedTabs
({
action
:
'
show
'
,
action
:
'
show
'
,
...
...
spec/javascripts/commits_spec.js
View file @
037b0706
...
@@ -5,15 +5,6 @@ import '~/pager';
...
@@ -5,15 +5,6 @@ import '~/pager';
import
'
~/commits
'
;
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
'
,
()
=>
{
describe
(
'
Commits List
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
setFixtures
(
`
setFixtures
(
`
...
@@ -61,9 +52,7 @@ import '~/commits';
...
@@ -61,9 +52,7 @@ import '~/commits';
CommitsList
.
init
(
25
);
CommitsList
.
init
(
25
);
CommitsList
.
searchField
.
val
(
''
);
CommitsList
.
searchField
.
val
(
''
);
if
(
!
phantomjs
)
{
spyOn
(
history
,
'
replaceState
'
).
and
.
stub
();
spyOn
(
history
,
'
replaceState
'
).
and
.
stub
();
}
ajaxSpy
=
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
((
req
)
=>
{
ajaxSpy
=
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
((
req
)
=>
{
req
.
success
({
req
.
success
({
data
:
'
<li>Result</li>
'
,
data
:
'
<li>Result</li>
'
,
...
...
spec/javascripts/merge_request_tabs_spec.js
View file @
037b0706
...
@@ -12,15 +12,6 @@ import '~/notes';
...
@@ -12,15 +12,6 @@ import '~/notes';
import
'
vendor/jquery.scrollTo
'
;
import
'
vendor/jquery.scrollTo
'
;
(
function
()
{
(
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
()
{
describe
(
'
MergeRequestTabs
'
,
function
()
{
var
stubLocation
=
{};
var
stubLocation
=
{};
var
setLocation
=
function
(
stubs
)
{
var
setLocation
=
function
(
stubs
)
{
...
@@ -37,11 +28,9 @@ import 'vendor/jquery.scrollTo';
...
@@ -37,11 +28,9 @@ import 'vendor/jquery.scrollTo';
this
.
class
=
new
gl
.
MergeRequestTabs
({
stubLocation
:
stubLocation
});
this
.
class
=
new
gl
.
MergeRequestTabs
({
stubLocation
:
stubLocation
});
setLocation
();
setLocation
();
if
(
!
phantomjs
)
{
this
.
spies
=
{
this
.
spies
=
{
history
:
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
callFake
(
function
()
{})
history
:
spyOn
(
window
.
history
,
'
replaceState
'
).
and
.
callFake
(
function
()
{})
};
};
}
});
});
afterEach
(
function
()
{
afterEach
(
function
()
{
...
@@ -208,11 +197,9 @@ import 'vendor/jquery.scrollTo';
...
@@ -208,11 +197,9 @@ import 'vendor/jquery.scrollTo';
pathname
:
'
/foo/bar/merge_requests/1
'
pathname
:
'
/foo/bar/merge_requests/1
'
});
});
newState
=
this
.
subject
(
'
commits
'
);
newState
=
this
.
subject
(
'
commits
'
);
if
(
!
phantomjs
)
{
expect
(
this
.
spies
.
history
).
toHaveBeenCalledWith
({
expect
(
this
.
spies
.
history
).
toHaveBeenCalledWith
({
url
:
newState
url
:
newState
},
document
.
title
,
newState
);
},
document
.
title
,
newState
);
}
});
});
it
(
'
treats "show" like "notes"
'
,
function
()
{
it
(
'
treats "show" like "notes"
'
,
function
()
{
...
...
spec/javascripts/pipeline_schedules/interval_pattern_input_spec.js
View file @
037b0706
...
@@ -95,7 +95,7 @@ describe('Interval Pattern Input Component', function () {
...
@@ -95,7 +95,7 @@ describe('Interval Pattern Input Component', function () {
describe
(
'
User Actions
'
,
function
()
{
describe
(
'
User Actions
'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
// For an unknown reason,
Phantom.js doesn't trigger
click events
// For an unknown reason,
some browsers do not propagate
click events
// on radio buttons in a way Vue can register. So, we have to mount
// on radio buttons in a way Vue can register. So, we have to mount
// to a fixture.
// to a fixture.
setFixtures
(
'
<div id="my-mount"></div>
'
);
setFixtures
(
'
<div id="my-mount"></div>
'
);
...
...
spec/javascripts/pipelines_spec.js
View file @
037b0706
import
Pipelines
from
'
~/pipelines
'
;
import
Pipelines
from
'
~/pipelines
'
;
// Fix for phantomJS
if
(
!
Element
.
prototype
.
matches
&&
Element
.
prototype
.
webkitMatchesSelector
)
{
Element
.
prototype
.
matches
=
Element
.
prototype
.
webkitMatchesSelector
;
}
describe
(
'
Pipelines
'
,
()
=>
{
describe
(
'
Pipelines
'
,
()
=>
{
preloadFixtures
(
'
static/pipeline_graph.html.raw
'
);
preloadFixtures
(
'
static/pipeline_graph.html.raw
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment