Fixed related userstories created test

stable
Jesús Espino 2017-09-20 10:29:09 +02:00
parent 94c9a00052
commit 5fa2400130
4 changed files with 6 additions and 5 deletions

View File

@ -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:

View File

@ -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()

View File

@ -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;

View File

@ -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