Skip to content

Commit

Permalink
Added questions to data set #2957
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Sep 11, 2023
1 parent 48c44c2 commit d68a728
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class DataSetController {
}

List projectProtocols = projectService.listProjectProtocols(project).collect{
println it
[label:it.name, value:it.externalId]
}

Expand Down
24 changes: 21 additions & 3 deletions src/test/groovy/au/org/ala/merit/DataSetControllerSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ class DataSetControllerSpec extends Specification implements ControllerUnitTest<
1 * projectService.getProgramConfiguration(project) >> [program:[name:"program 1"]]
1 * projectService.getAllProjectOutcomes(project) >> ["1", "2"]
1 * projectService.listProjectInvestmentPriorities(project) >> ["p1"]
1 * projectService.listProjectProtocols(project) >> [["name":"p1", "externalId":"p1"]]
1 * projectService.listProjectBaselines(project) >> [["code":"b1", baseline:"a baseline"]]

model == [project:project, projectId:'p1', programName:"program 1",
priorities:["p1"], outcomes:["1", "2"], projectOutcomes:[],
projectBaselines:[[label:"b1 - a baseline", value:"b1"]],
projectProtocols:[[label:"p1", value:"p1"]]]

model == [project:project, projectId:'p1', programName:"program 1", priorities:["p1"], outcomes:["1", "2"], projectOutcomes:[]]
}

void "If the project cannot be found when editing a dataset, a 404 is returned"() {
Expand Down Expand Up @@ -76,8 +82,14 @@ class DataSetControllerSpec extends Specification implements ControllerUnitTest<
1 * projectService.getProgramConfiguration(project) >> [program:[name:"program 1"]]
1 * projectService.getAllProjectOutcomes(project) >> ["1", "2"]
1 * projectService.listProjectInvestmentPriorities(project) >> ["p1"]
1 * projectService.listProjectProtocols(project) >> [["name":"p1", "externalId":"p1"]]
1 * projectService.listProjectBaselines(project) >> [["code":"b1", baseline:"a baseline"]]


model == [project:project, projectId:'p1', programName:"program 1", priorities:["p1"], outcomes:["1", "2"], projectOutcomes:[], dataSet:existingDataSets[1]]
model == [project:project, projectId:'p1', programName:"program 1", priorities:["p1"],
outcomes:["1", "2"], projectOutcomes:[], dataSet:existingDataSets[1],
projectBaselines:[[label:"b1 - a baseline", value:"b1"]],
projectProtocols:[[label:"p1", value:"p1"]]]
}

void "The save method delegates to the projectService"() {
Expand Down Expand Up @@ -134,7 +146,13 @@ class DataSetControllerSpec extends Specification implements ControllerUnitTest<
1 * projectService.getProgramConfiguration(project) >> [program:[name:"program 1"]]
1 * projectService.getAllProjectOutcomes(project) >> ["1", "2"]
1 * projectService.listProjectInvestmentPriorities(project) >> ["p1"]
1 * projectService.listProjectProtocols(project) >> [["name":"p1", "externalId":"p1"]]
1 * projectService.listProjectBaselines(project) >> [["code":"b1", baseline:"a baseline"]]


model == [project:project, projectId:'p1', programName:"program 1", priorities:["p1"], outcomes:["1", "2"], projectOutcomes:[], dataSet:existingDataSets[1]]
model == [project:project, projectId:'p1', programName:"program 1", priorities:["p1"],
outcomes:["1", "2"], projectOutcomes:[], dataSet:existingDataSets[1],
projectBaselines:[[label:"b1 - a baseline", value:"b1"]],
projectProtocols:[[label:"p1", value:"p1"]]]
}
}
3 changes: 2 additions & 1 deletion src/test/js/spec/DataSetsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ describe("The data set summaries view models behave correctly", function () {
"sizeUnknown": false,
"otherSensitivity":null,
"otherDataSetType":null,
"sizeInKB": 205
"sizeInKB": 205,
"protocol":"guid-1"
};
}

Expand Down

0 comments on commit d68a728

Please sign in to comment.