Fixed related userstories created test
parent
94c9a00052
commit
5fa2400130
|
@ -37,10 +37,11 @@ class RelatedUserstoriesCreateController
|
|||
@.projects = @currentUserService.projects.get("all")
|
||||
|
||||
filterUss: (selectedProjectId, filterText) ->
|
||||
@rs.userstories.listInAllProjects({project: selectedProjectId, q: filterText}, true).then (data) =>
|
||||
promise = @rs.userstories.listInAllProjects({project: selectedProjectId, q: filterText}, true).then (data) =>
|
||||
excludeIds = @.epicUserstories.map((us) -> us.get('id'))
|
||||
filteredData = data.filter((us) -> excludeIds.indexOf(us.get('id')) == -1)
|
||||
@.projectUserstories = filteredData
|
||||
promise
|
||||
|
||||
saveRelatedUserStory: (selectedUserstoryId, onSavedRelatedUserstory) ->
|
||||
# This method assumes the following methods are binded to the controller:
|
||||
|
|
|
@ -44,7 +44,7 @@ describe "RelatedUserstoriesCreate", ->
|
|||
_mockTgResources = () ->
|
||||
mocks.tgResources = {
|
||||
userstories: {
|
||||
listAllInProject: sinon.stub()
|
||||
listInAllProjects: sinon.stub()
|
||||
}
|
||||
epics: {
|
||||
deleteRelatedUserstory: sinon.stub()
|
||||
|
@ -106,7 +106,7 @@ describe "RelatedUserstoriesCreate", ->
|
|||
}
|
||||
])
|
||||
|
||||
promise = mocks.tgResources.userstories.listAllInProject.withArgs(1).promise().resolve(userstories)
|
||||
promise = mocks.tgResources.userstories.listInAllProjects.withArgs({project:1, q:""}).promise().resolve(userstories)
|
||||
RelatedUserstoriesCreateCtrl.filterUss(1, "").then () ->
|
||||
expect(RelatedUserstoriesCreateCtrl.projectUserstories.toJS()).to.eql(filteredUserstories.toJS())
|
||||
done()
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
margin-bottom: 1rem;
|
||||
}
|
||||
.no-stories-found {
|
||||
padding: 1rem 0 0 0;
|
||||
padding: 1rem 0 0;
|
||||
}
|
||||
.new-user-story-options {
|
||||
display: flex;
|
||||
|
|
|
@ -707,7 +707,7 @@ gulp.task("express", function() {
|
|||
res.sendFile("index.html", {root: __dirname + "/dist/"});
|
||||
});
|
||||
|
||||
app.listen(9001);
|
||||
app.listen(9002);
|
||||
});
|
||||
|
||||
//Rerun the task when a file changes
|
||||
|
|
Loading…
Reference in New Issue