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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
fe2e8dba
Commit
fe2e8dba
authored
Feb 01, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed infinite loop crashing tests
parent
4cea24f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
spec/javascripts/pager_spec.js
spec/javascripts/pager_spec.js
+13
-8
No files found.
spec/javascripts/pager_spec.js
View file @
fe2e8dba
...
@@ -47,12 +47,12 @@ describe('pager', () => {
...
@@ -47,12 +47,12 @@ describe('pager', () => {
});
});
describe
(
'
getOld
'
,
()
=>
{
describe
(
'
getOld
'
,
()
=>
{
const
urlRegex
=
/
\/
some_list
(
.*
)
$/
;
const
urlRegex
=
/
(
.*
)
some_list
(
.*
)
$/
;
let
mock
;
let
mock
;
function
mockSuccess
()
{
function
mockSuccess
()
{
mock
.
onGet
(
urlRegex
).
reply
(
200
,
{
mock
.
onGet
(
urlRegex
).
reply
(
200
,
{
count
:
2
0
,
count
:
0
,
html
:
''
,
html
:
''
,
});
});
}
}
...
@@ -65,9 +65,9 @@ describe('pager', () => {
...
@@ -65,9 +65,9 @@ describe('pager', () => {
setFixtures
(
'
<div class="content_list" data-href="/some_list"></div><div class="loading"></div>
'
);
setFixtures
(
'
<div class="content_list" data-href="/some_list"></div><div class="loading"></div>
'
);
spyOn
(
axios
,
'
get
'
).
and
.
callThrough
();
spyOn
(
axios
,
'
get
'
).
and
.
callThrough
();
Pager
.
init
();
mock
=
new
MockAdapter
(
axios
);
mock
=
new
MockAdapter
(
axios
);
Pager
.
init
();
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -119,10 +119,15 @@ describe('pager', () => {
...
@@ -119,10 +119,15 @@ describe('pager', () => {
Pager
.
getOld
();
Pager
.
getOld
();
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
[
url
,
params
]
=
$
.
ajax
.
calls
.
argsFor
(
0
);
const
[
url
,
params
]
=
axios
.
get
.
calls
.
argsFor
(
0
);
console
.
log
(
url
,
params
);
// expect(data).toBe('limit=20&offset=100');
expect
(
params
).
toEqual
({
// expect(url).toBe('/some_list');
params
:
{
limit
:
20
,
offset
:
100
,
},
});
expect
(
url
).
toBe
(
'
/some_list
'
);
done
();
done
();
});
});
...
...
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