-
Notifications
You must be signed in to change notification settings - Fork 199
/
AddFiles.spec.js
39 lines (30 loc) · 1.72 KB
/
AddFiles.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require([
'JBrowse/View/FileDialog/TrackList/BAMDriver'
], function( BAMDriver ) {
describe( 'BAM driver', function() {
it( 'can match a simple BAM URL with its BAI URL', function( ) {
var confs = { foo: { baiUrlTemplate: 'zee.bam.bai' } };
expect( BAMDriver.tryResource( confs, { type: 'bam', url: 'zee.bam' } ) )
.toBeTruthy();
expect( confs.foo.bam.url ).toEqual( 'zee.bam' );
});
it( 'can match a simple BAM file with its BAI URL', function( ) {
var confs = { foo: { baiUrlTemplate: 'zee.bam.bai' } };
expect( BAMDriver.tryResource( confs, { type: 'bam', file: { name: 'zee.bam'} } ) )
.toBeTruthy();
expect( confs.foo.bam.blob.name ).toEqual( 'zee.bam' );
});
it( 'matches a BAI file like zee.bai -> zee.bam', function( ) {
var confs = { foo: { urlTemplate: '/zee.bam' } };
expect( BAMDriver.tryResource( confs, { type: 'bai', file: { name: 'zee.bai'} } ) )
.toBeTruthy();
expect( confs.foo.bai.blob.name ).toEqual( 'zee.bai' );
});
it( 'matches a BAM file like zee.bam -> zee.bai', function( ) {
var confs = { foo: { baiUrlTemplate: '/zee.bai' } };
expect( BAMDriver.tryResource( confs, { type: 'bam', file: { name: 'zee.bam'} } ) )
.toBeTruthy();
expect( confs.foo.bam.blob.name ).toEqual( 'zee.bam' );
});
});
});