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
ccb46963
Commit
ccb46963
authored
Nov 08, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ineffective Vue service specs in EE
parent
01932584
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
110 deletions
+0
-110
spec/javascripts/issuable/related_issues/services/related_issues_service_spec.js
...le/related_issues/services/related_issues_service_spec.js
+0
-110
No files found.
spec/javascripts/issuable/related_issues/services/related_issues_service_spec.js
deleted
100644 → 0
View file @
01932584
import
_
from
'
underscore
'
;
import
Vue
from
'
vue
'
;
import
RelatedIssuesService
from
'
~/issuable/related_issues/services/related_issues_service
'
;
const
issuable1
=
{
id
:
200
,
reference
:
'
foo/bar#123
'
,
title
:
'
some title
'
,
path
:
'
/foo/bar/issues/123
'
,
state
:
'
opened
'
,
destroy_relation_path
:
'
/foo/bar/issues/123/related_issues/1
'
,
};
describe
(
'
RelatedIssuesService
'
,
()
=>
{
let
service
;
beforeEach
(()
=>
{
service
=
new
RelatedIssuesService
(
''
);
});
describe
(
'
fetchRelatedIssues
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
next
(
request
.
respondWith
(
JSON
.
stringify
([
issuable1
]),
{
status
:
200
,
}));
};
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
});
it
(
'
fetch related issues
'
,
(
done
)
=>
{
service
.
fetchRelatedIssues
()
.
then
(
res
=>
res
.
json
())
.
then
((
relatedIssues
)
=>
{
expect
(
relatedIssues
).
toEqual
([
issuable1
]);
done
();
})
.
catch
((
err
)
=>
{
done
.
fail
(
`Failed to fetch related issues:\n
${
err
}
`
);
});
});
});
describe
(
'
addRelatedIssues
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
next
(
request
.
respondWith
(
JSON
.
stringify
({
message
:
`
${
issuable1
.
reference
}
was successfully related`
,
status
:
'
success
'
,
}),
{
status
:
200
,
}));
};
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
});
it
(
'
add related issues
'
,
(
done
)
=>
{
service
.
addRelatedIssues
([
issuable1
.
reference
])
.
then
(
res
=>
res
.
json
())
.
then
((
resData
)
=>
{
expect
(
resData
.
status
).
toEqual
(
'
success
'
);
done
();
})
.
catch
((
err
)
=>
{
done
.
fail
(
`Failed to add related issues:\n
${
err
}
`
);
});
});
});
describe
(
'
removeRelatedIssue
'
,
()
=>
{
const
interceptor
=
(
request
,
next
)
=>
{
next
(
request
.
respondWith
(
JSON
.
stringify
({
message
:
'
Relation was removed
'
,
status
:
'
success
'
,
}),
{
status
:
200
,
}));
};
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
interceptor
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
interceptor
);
});
it
(
'
remove related issue
'
,
(
done
)
=>
{
service
.
removeRelatedIssue
(
'
...
'
)
.
then
(
res
=>
res
.
json
())
.
then
((
resData
)
=>
{
expect
(
resData
.
status
).
toEqual
(
'
success
'
);
done
();
})
.
catch
((
err
)
=>
{
done
.
fail
(
`Failed to fetch issue:\n
${
err
}
`
);
});
});
});
});
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