Skip to content

Commit

Permalink
Test VariantTrack in components-test
Browse files Browse the repository at this point in the history
Previously it looked like the VariantTrack was being tested, but it
really wasn't (the d3 methods were being called with empty arrays). With
canvas, the drawing code clearly wasn't being run. Now it is.
  • Loading branch information
danvk committed Sep 25, 2015
1 parent a39bff4 commit 638c3ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/components-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ describe('pileup', function() {

var ready = (() =>
drawnObjectsWith(div, '.reference', x => x.letter).length > 0 &&
drawnObjectsWith(div, '.variants', x => x.alt).length > 0 &&
drawnObjectsWith(div, '.genes', x => x.name).length > 0 &&
drawnObjectsWith(div, '.pileup', x => x.span).length > 0
);
Expand All @@ -90,6 +91,12 @@ describe('pileup', function() {
var basepairs = drawnObjectsWith(div, '.reference', x => x.letter);
expect(basepairs).to.have.length.at.least(10);

var variants = drawnObjectsWith(div, '.variants', x => x.alt);
expect(variants).to.have.length(1);
expect(variants[0].position).to.equal(125);
expect(variants[0].ref).to.equal('G');
expect(variants[0].alt).to.equal('T');

var geneTexts = callsOf(div, '.genes', 'fillText');
expect(geneTexts).to.have.length(1);
expect(geneTexts[0][1]).to.equal('TP53');
Expand Down
1 change: 1 addition & 0 deletions test-data/snv.chr17.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
##FORMAT=<ID=FREQ,Number=1,Type=String,Description="Variant allele frequency">
##FORMAT=<ID=DP4,Number=4,Type=Integer,Description="Strand read counts: ref/fwd, ref/rev, var/fwd, var/rev">
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NORMAL TUMOR
17 125 . G T . PASS DP=81;SS=1;SSC=2;GPV=4.6768E-16;SPV=5.4057E-1 GT:GQ:DP:RD:AD:FREQ:DP4 0/1:.:44:22:22:50%:16,6,9,13 0/1:.:37:18:19:51.35%:10,8,10,9
17 7512444 . G T . PASS DP=81;SS=1;SSC=2;GPV=4.6768E-16;SPV=5.4057E-1 GT:GQ:DP:RD:AD:FREQ:DP4 0/1:.:44:22:22:50%:16,6,9,13 0/1:.:37:18:19:51.35%:10,8,10,9
17 7512454 . C A . PASS DP=68;SS=1;SSC=1;GPV=1.4855E-11;SPV=7.5053E-1 GT:GQ:DP:RD:AD:FREQ:DP4 0/1:.:32:17:15:46.88%:9,8,9,6 0/1:.:36:21:15:41.67%:8,13,8,7
17 7512544 . C T . PASS DP=72;SS=1;SSC=7;GPV=3.6893E-16;SPV=1.8005E-1 GT:GQ:DP:RD:AD:FREQ:DP4 0/1:.:39:19:19:50%:8,11,11,8 0/1:.:33:12:21:63.64%:5,7,8,13
Expand Down

0 comments on commit 638c3ff

Please sign in to comment.