Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
766295f08c22
Commit
1332d234
authored
Feb 01, 2018
by
Phil Hughes
Browse files
fixed infinite loop crashing tests
parent
8dcbc3cda5b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
spec/javascripts/pager_spec.js
View file @
766295f0
...
...
@@ -47,12 +47,12 @@ describe('pager', () => {
});
describe
(
'
getOld
'
,
()
=>
{
const
urlRegex
=
/
\/
some_list
(
.*
)
$/
;
const
urlRegex
=
/
(
.*
)
some_list
(
.*
)
$/
;
let
mock
;
function
mockSuccess
()
{
mock
.
onGet
(
urlRegex
).
reply
(
200
,
{
count
:
2
0
,
count
:
0
,
html
:
''
,
});
}
...
...
@@ -65,9 +65,9 @@ describe('pager', () => {
setFixtures
(
'
<div class="content_list" data-href="/some_list"></div><div class="loading"></div>
'
);
spyOn
(
axios
,
'
get
'
).
and
.
callThrough
();
Pager
.
init
();
mock
=
new
MockAdapter
(
axios
);
Pager
.
init
();
});
afterEach
(()
=>
{
...
...
@@ -119,10 +119,15 @@ describe('pager', () => {
Pager
.
getOld
();
setTimeout
(()
=>
{
const
[
url
,
params
]
=
$
.
ajax
.
calls
.
argsFor
(
0
);
console
.
log
(
url
,
params
);
// expect(data).toBe('limit=20&offset=100');
// expect(url).toBe('/some_list');
const
[
url
,
params
]
=
axios
.
get
.
calls
.
argsFor
(
0
);
expect
(
params
).
toEqual
({
params
:
{
limit
:
20
,
offset
:
100
,
},
});
expect
(
url
).
toBe
(
'
/some_list
'
);
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