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