Skip to content

Commit

Permalink
Test for css classes
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed May 7, 2015
1 parent 50982dc commit 7420222
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions test/components-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,32 @@ describe('pileup', function() {
isReference: true,
data: pileup.formats.twoBit({
url: '/test/data/test.2bit'
})
}),
cssClass: 'a'
},
{
viz: pileup.viz.variants(),
data: pileup.formats.vcf({
url: '/test/data/snv.chr17.vcf'
})
}),
cssClass: 'b'
},
{
viz: pileup.viz.genes(),
data: pileup.formats.bigBed({
// This file contains just TP53, shifted so that it starts at the
// beginning of chr17 (to match test.2bit). See test/data/README.md.
url: '/test/data/tp53.shifted.bb'
})
}),
cssClass: 'c'
},
{
viz: pileup.viz.pileup(),
data: pileup.formats.bam({
url: '/test/data/index_test.bam',
indexUrl: '/test/data/index_test.bam.bai'
})
url: '/test/data/chr17.1-250.bam',
indexUrl: '/test/data/chr17.1-250.bam.bai'
}),
cssClass: 'd'
}
];

Expand All @@ -85,7 +89,8 @@ describe('pileup', function() {

var ready = (() =>
div.querySelectorAll('.basepair').length > 0 &&
div.querySelectorAll('.gene').length > 0
div.querySelectorAll('.gene').length > 0 &&
div.querySelectorAll('.alignment').length > 0
);

return waitFor(ready, 5000)
Expand All @@ -98,6 +103,11 @@ describe('pileup', function() {

// Note: there are 11 exons, but two are split into coding/non-coding
expect(div.querySelectorAll('.gene .exon').length).to.equal(13);

expect(div.querySelector('div > .a').className).to.equal('reference a');
expect(div.querySelector('div > .b').className).to.equal('variants b');
expect(div.querySelector('div > .c').className).to.equal('genes c');
expect(div.querySelector('div > .d').className).to.equal('pileup d');
});
});
});

0 comments on commit 7420222

Please sign in to comment.