-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] Added
Assessment Tool
annoatatoins to the JSON output file (#588
) * Implemented `getAssessmentToolJSONOutput` getter * Implemented unit test for `getAssessmentToolJSONOutput` getter * Added `Assessment Tool` annotations to the JSON output * Addressed comments from PR review
- Loading branch information
Showing
4 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
cypress/unit/store-getter-getAssessmentToolJSONOutput.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { getters } from "~/store"; | ||
|
||
let store = { | ||
|
||
getters: getters, | ||
|
||
state: { | ||
dataDictionary: { | ||
annotated: { | ||
column1: { | ||
Description: "Some cool description here.", | ||
missingValues: ["Missing"] | ||
} | ||
} | ||
}, | ||
toolTerms: [ | ||
{ | ||
label: "MOCA", | ||
identifier: "cogAtlas:MOCA", | ||
selected: false | ||
} | ||
], | ||
columnToToolMap: { | ||
column1: "cogAtlas:MOCA" | ||
} | ||
|
||
} | ||
}; | ||
|
||
describe("getAssessmentToolJSONOutput", () => { | ||
|
||
it("Make sure Assessment tool json output is schema compliant", () => { | ||
|
||
const output = store.getters.getAssessmentToolJSONOutput(store.state)("column1"); | ||
expect(output).to.deep.equal( | ||
{ | ||
Annotations: { | ||
IsAbout: { | ||
"TermURL": "nb:Assessment", | ||
"Label": "Assessment tool" | ||
}, | ||
"IsPartOf": { | ||
"TermURL": "cogAtlas:MOCA", | ||
"Label": "MOCA" | ||
}, | ||
MissingValues: ["Missing"] | ||
}, | ||
Description: "Some cool description here." | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters