Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions snprc_scheduler/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"snapshotSerializers":[
"enzyme-to-json/serializer"
],
"setupFiles": [
"raf/polyfill",
"<rootDir>/src/client/tests/setupTests.js"
]
}
104 changes: 104 additions & 0 deletions snprc_scheduler/src/client/tests/fixtures/animalData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@


const animalData = [ {
"StartDate" : {
"value" : "2017/04/13 00:00:00"
},
"RevisionNum" : {
"value" : 0
},
"ProjectId" : {
"value" : 1
},
"Id" : {
"value" : "11111",
"url" : "/labkey/ehr/SNPRC/participantView.view?participantId=17275"
},
"Gender" : {
"value" : "F",
"url" : "/labkey/query/SNPRC/detailsQueryRow.view?schemaName=ehr_lookups&query.queryName=gender_codes&code=F",
"displayValue" : "Female"
},
"Iacuc" : {
"value" : "1425MM",
"url" : "/labkey/ehr/SNPRC/protocolDetails.view?protocol=1425MM"
},
"ChargeId" : {
"value" : 435
},
"AssignmentStatus" : {
"value" : "A",
"url" : "/labkey/query/SNPRC/recordDetails.view?schemaName=ehr_lookups&query.queryName=assignment_status&keyField=value&key=A"
},
"EndDate" : {
"value" : null
}
}, {
"StartDate" : {
"value" : "2017/04/13 00:00:00"
},
"RevisionNum" : {
"value" : 0
},
"ProjectId" : {
"value" : 1
},
"Id" : {
"value" : "22222",
"url" : "/labkey/ehr/SNPRC/participantView.view?participantId=31386"
},
"Gender" : {
"value" : "M",
"url" : "/labkey/query/SNPRC/detailsQueryRow.view?schemaName=ehr_lookups&query.queryName=gender_codes&code=M",
"displayValue" : "Female"
},
"Iacuc" : {
"value" : "1425MM",
"url" : "/labkey/ehr/SNPRC/protocolDetails.view?protocol=1425MM"
},
"ChargeId" : {
"value" : 435
},
"AssignmentStatus" : {
"value" : "A",
"url" : "/labkey/query/SNPRC/recordDetails.view?schemaName=ehr_lookups&query.queryName=assignment_status&keyField=value&key=A"
},
"EndDate" : {
"value" : null
}
}, {
"StartDate" : {
"value" : "2017/04/13 00:00:00"
},
"RevisionNum" : {
"value" : 0
},
"ProjectId" : {
"value" : 1
},
"Id" : {
"value" : "33333",
"url" : "/labkey/ehr/SNPRC/participantView.view?participantId=33003"
},
"Gender" : {
"value" : "M",
"url" : "/labkey/query/SNPRC/detailsQueryRow.view?schemaName=ehr_lookups&query.queryName=gender_codes&code=M",
"displayValue" : "Male"
},
"Iacuc" : {
"value" : "1425MM",
"url" : "/labkey/ehr/SNPRC/protocolDetails.view?protocol=1425MM"
},
"ChargeId" : {
"value" : 435
},
"AssignmentStatus" : {
"value" : "A",
"url" : "/labkey/query/SNPRC/recordDetails.view?schemaName=ehr_lookups&query.queryName=assignment_status&keyField=value&key=A"
},
"EndDate" : {
"value" : null
}
} ];

export {animalData};
78 changes: 78 additions & 0 deletions snprc_scheduler/src/client/tests/fixtures/projectData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
const projectData = [{
"endDate": "2019-12-31",
"ProjectObjectId": "55130483-F7DD-4366-8FA3-55ED58115482",
"CostAccount": "1474-001",
"active": true,
"VsNumber": null,
"description": "Test data 1",
"projectId": 1,
"revisionNum": 0,
"Iacuc": "1042PC",
"referenceId": 48,
"Veterinarian1": "vet1",
"Veterinarian2": "vet2",
"hasEvent": false,
"ProjectType": "Research",
"startDate": "2008-06-04",
"FeeSchedule": null,
"objectId": "55130483-F7DD-4366-8FA3-55ED58115482",
"ProjectItems": [{
"superPkgId": 2361,
"_row": 1,
"description": "Research sedation",
"pkgId": 222,
"projectItemId": 79664
}, {
"superPkgId": 1590,
"_row": 2,
"description": "I need a research package",
"pkgId": 81,
"projectItemId": 79752
}, {
"superPkgId": 1244,
"_row": 3,
"description": "Move to location",
"pkgId": 13,
"projectItemId": 79777
}]
},
{
"endDate": "2019-12-31",
"ProjectObjectId": "55130483-F7DD-4366-8FA3-55ED58115482",
"CostAccount": "1474-001",
"active": true,
"VsNumber": null,
"description": "Test data 2",
"projectId": 2,
"revisionNum": 0,
"Iacuc": "1042PC",
"referenceId": 48,
"Veterinarian1": "vet11",
"Veterinarian2": "vet22",
"hasEvent": false,
"ProjectType": "Research",
"startDate": "2008-06-04",
"FeeSchedule": null,
"objectId": "55130483-F7DD-4366-8FA3-55ED58115482",
"ProjectItems": [{
"superPkgId": 2361,
"_row": 1,
"description": "Research sedation",
"pkgId": 222,
"projectItemId": 79664
}, {
"superPkgId": 1590,
"_row": 2,
"description": "I need a research package",
"pkgId": 81,
"projectItemId": 79752
}, {
"superPkgId": 1244,
"_row": 3,
"description": "Move to location",
"pkgId": 13,
"projectItemId": 79777
}]
}];

export {projectData};
89 changes: 89 additions & 0 deletions snprc_scheduler/src/client/tests/fixtures/timelineData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@


// test data
const timelineData = [{
"Description" : "Timeline #1 revision 0",
"ProjectObjectId" : "55130483-F7DD-4366-8FA3-55ED58115482",
"SchedulerNotes" : "Of all the things i've lost in life, i miss your mind the most",
"EndDate" : "2018/12/30 00:00:00",
"Created" : "2018/09/20 00:00:00",
"StartDate" : "2018/02/01 00:00:00",
"LeadTechs" : "Henry Ford, Nicoli Tesla",
"TimelineId" : 1,
"RevisionNum" : 0,
"Notes" : "Don't take any wooden nickels.",
"TimelineItems" : [ {
"StudyDay" : 0,
"ScheduleDate" : null,
"ProjectItemId" : 79777
}, {
"StudyDay" : 1,
"ScheduleDate" : null,
"ProjectItemId" : 80069
}, {
"StudyDay" : 2,
"ScheduleDate" : null,
"ProjectItemId" : 80220
}, {
"StudyDay" : 2,
"ScheduleDate" : null,
"ProjectItemId" : 81070
} ],
"TimelineAnimalItems" : [ {
"AnimalId" : "11111",
"Gender" : "F",
"AssignmentStatus" : "A",
"EndDate" : null,
"Weight" : 18.26,
"Age" : "12.1 years"
}, {
"AnimalId" : "11112",
"Gender" : "F",
"AssignmentStatus" : "A",
"EndDate" : null,
"Weight" : 12.38,
"Age" : "12.1 years"
} ]
},
{
"Description" : "Timeline #4 new Revision 3",
"ProjectObjectId" : "55130483-F7DD-4366-8FA3-55ED58115482",
"SchedulerNotes" : "Of all the things i've lost in life, i miss my mind the most",
"EndDate" : "2018/12/30 00:00:00",
"Created" : "2018/09/20 00:00:00",
"StartDate" : "2018/02/01 00:00:00",
"LeadTechs" : "Herman Munster",
"TimelineId" : 119,
"RevisionNum" : 0,
"Notes" : "Ha ha ha.",
"TimelineItems" : [ {
"StudyDay" : 110,
"ScheduleDate" : null,
"ProjectItemId" : 79664
}, {
"StudyDay" : 100,
"ScheduleDate" : null,
"ProjectItemId" : 79752
}, {
"StudyDay" : 0,
"ScheduleDate" : null,
"ProjectItemId" : 79777
} ],
"TimelineAnimalItems" : [ {
"AnimalId" : "22221",
"Gender" : "F",
"AssignmentStatus" : "A",
"EndDate" : null,
"Weight" : 18.26,
"Age" : "12.1 years"
}, {
"AnimalId" : "22222",
"Gender" : "F",
"AssignmentStatus" : "A",
"EndDate" : null,
"Weight" : 12.38,
"Age" : "12.1 years"
}]
}];

export {timelineData};
Loading