-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e116f4e
commit 11ad3de
Showing
5 changed files
with
54 additions
and
5 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
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,2 @@ | ||
--reporter dot | ||
--ui bdd |
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,45 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('../utils'); | ||
|
||
describe('Utils', function () { | ||
describe('#getChartDescription', function () { | ||
it('should construct description for a sponsor', function () { | ||
var data = { | ||
overdue: 4, | ||
rate: 0.4, | ||
total: 10 | ||
}, name = 'Sanofi', orgName = 'sanofi'; | ||
var description = utils.getChartDescription(data, name, orgName); | ||
var expected = "Since Jan 2006, <strong>Sanofi</strong> completed" + | ||
" 10 eligible trials and <strong><span style='color: #ff4800'>" + | ||
"hasn't published results for 4 trials</span></strong>. That " + | ||
"means 40.0% of its trials are missing results. See " + | ||
"<a target='_blank' href='https://clinicaltrials.gov/ct2/" + | ||
"results/displayOpt?flds=a&flds=b&flds=f&flds=c&flds=g&flds=s" + | ||
"&flds=u&submit_fld_opt=on&recr=Completed&type=Intr&lead=Sanofi" + | ||
"&lead_ex=Y&show_flds=Y'>all its completed trials on " + | ||
"ClinicalTrials.gov <span style='font-size: 60%' " + | ||
"class='glyphicon glyphicon-new-window'></span></a>."; | ||
expect(description).to.equal(expected); | ||
}); | ||
|
||
it('should construct description for all sponsors', function () { | ||
var data = { | ||
overdue: 40, | ||
rate: 0.4, | ||
total: 100 | ||
}, name = 'all major trial sponsors', orgName = ''; | ||
var description = utils.getChartDescription(data, name, orgName); | ||
var expected = "Since Jan 2006, <strong>all major trial " + | ||
"sponsors</strong> completed" + | ||
" 100 eligible trials and <strong><span style='color: #ff4800'> " + | ||
"haven't published results for 40 trials</span></strong>. That " + | ||
"means 40.0% of their trials are missing results. "; | ||
expect(description).to.equal(expected); | ||
}); | ||
}); | ||
// describe('#reshapeData', function () { | ||
// it('should reshape our data', function () { | ||
// }); | ||
// }); | ||
}); |
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