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
1f2870c3
Commit
1f2870c3
authored
Feb 21, 2018
by
Simon Knox
Committed by
Phil Hughes
Feb 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Transient failure of related_issues_root_spec.js"
parent
3ab12f71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
61 deletions
+38
-61
spec/javascripts/issuable/related_issues/components/related_issues_root_spec.js
...ble/related_issues/components/related_issues_root_spec.js
+38
-61
No files found.
spec/javascripts/issuable/related_issues/components/related_issues_root_spec.js
View file @
1f2870c3
...
...
@@ -140,12 +140,10 @@ describe('RelatedIssuesRoot', () => {
vm
.
onPendingFormSubmit
();
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
state
.
pendingReferences
.
length
).
toEqual
(
0
);
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
0
);
expect
(
vm
.
state
.
pendingReferences
.
length
).
toEqual
(
0
);
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
0
);
done
();
});
done
();
});
});
...
...
@@ -167,15 +165,13 @@ describe('RelatedIssuesRoot', () => {
vm
.
onPendingFormSubmit
();
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
state
.
pendingReferences
.
length
).
toEqual
(
0
);
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
1
);
expect
(
vm
.
state
.
relatedIssues
[
0
].
id
).
toEqual
(
issuable1
.
id
);
expect
(
vm
.
state
.
pendingReferences
.
length
).
toEqual
(
0
);
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
1
);
expect
(
vm
.
state
.
relatedIssues
[
0
].
id
).
toEqual
(
issuable1
.
id
);
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
done
();
});
done
();
});
});
...
...
@@ -197,16 +193,14 @@ describe('RelatedIssuesRoot', () => {
vm
.
onPendingFormSubmit
();
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
state
.
pendingReferences
.
length
).
toEqual
(
0
);
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
2
);
expect
(
vm
.
state
.
relatedIssues
[
0
].
id
).
toEqual
(
issuable1
.
id
);
expect
(
vm
.
state
.
relatedIssues
[
1
].
id
).
toEqual
(
issuable2
.
id
);
expect
(
vm
.
state
.
pendingReferences
.
length
).
toEqual
(
0
);
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
2
);
expect
(
vm
.
state
.
relatedIssues
[
0
].
id
).
toEqual
(
issuable1
.
id
);
expect
(
vm
.
state
.
relatedIssues
[
1
].
id
).
toEqual
(
issuable2
.
id
);
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
done
();
});
done
();
});
});
});
...
...
@@ -230,63 +224,46 @@ describe('RelatedIssuesRoot', () => {
});
describe
(
'
fetchRelatedIssues
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
next
(
request
.
respondWith
(
JSON
.
stringify
([
issuable1
,
issuable2
]),
{
status
:
200
,
}));
};
beforeEach
((
done
)
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
vm
=
new
RelatedIssuesRoot
({
propsData
:
defaultProps
,
}).
$mount
();
// wait for internal call to fetchRelatedIssues to resolve
setTimeout
(
()
=>
Vue
.
nextTick
(
done
)
);
setTimeout
(
done
);
});
describe
(
'
when the network has not responded yet
'
,
()
=>
{
it
(
'
should be fetching
'
,
(
done
)
=>
{
vm
.
fetchRelatedIssues
();
expect
(
vm
.
isFetching
).
toEqual
(
true
);
setTimeout
(()
=>
Vue
.
nextTick
(
done
));
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
});
describe
(
'
when the network responds
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
next
(
request
.
respondWith
(
JSON
.
stringify
([
issuable1
,
issuable2
]),
{
status
:
200
,
}));
};
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
});
it
(
'
sets isFetching while fetching
'
,
(
done
)
=>
{
vm
.
fetchRelatedIssues
();
it
(
'
should be done fetching
'
,
(
done
)
=>
{
vm
.
fetchRelatedIssues
();
expect
(
vm
.
isFetching
).
toEqual
(
true
);
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
isFetching
).
toEqual
(
false
);
setTimeout
(()
=>
{
expect
(
vm
.
isFetching
).
toEqual
(
false
);
done
();
});
});
done
();
});
});
it
(
'
should fetch related issues
'
,
(
done
)
=>
{
vm
.
fetchRelatedIssues
();
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
2
);
expect
(
vm
.
state
.
relatedIssues
[
0
].
id
).
toEqual
(
issuable1
.
id
);
expect
(
vm
.
state
.
relatedIssues
[
1
].
id
).
toEqual
(
issuable2
.
id
);
it
(
'
should fetch related issues
'
,
(
done
)
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
state
.
relatedIssues
.
length
).
toEqual
(
2
);
expect
(
vm
.
state
.
relatedIssues
[
0
].
id
).
toEqual
(
issuable1
.
id
);
expect
(
vm
.
state
.
relatedIssues
[
1
].
id
).
toEqual
(
issuable2
.
id
);
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