Code coverage report for test/unit/biojs_test_test.js

Statements: 100% (21 / 21)      Branches: 100% (0 / 0)      Functions: 100% (7 / 7)      Lines: 100% (21 / 21)      Ignored: none     

All files » test/unit/ » biojs_test_test.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 39 40 41 42 43 44 45 46 47 48 49 50 51 52                  1     1       1 1     1 1 1   1   1   1 1 1 1       1 1   1 1     1 1     1 1        
/*
 * biojs-vis-proteinFeaturesViewer
 * https://github.com/ebi-uniprot/biojs-vis-proteinFeaturesViewer
 *
 * Copyright (c) 2014 ebi-uniprot
 * Licensed under the Apache 2 license.
 */
 
// chai is an assertion library
var chai = require('chai');
 
// @see http://chaijs.com/api/assert/
var assert = chai.assert;
 
// register alternative styles
// @see http://chaijs.com/api/bdd/
chai.expect();
chai.should();
 
// requires your main app
var FeaturesViewer = require('../..');
var DataLoader = require('../../lib/dataLoader');
var NonOverlappingLayout = require('../../lib/NonOverlappingLayout');
 
describe('FeaturesViewer', function() {
 
	var data = require('../../snippets/data/features.json');
 
	describe('DataLoader', function() {
		it('should process the data', function() {
			var d = DataLoader.processData(data);
			assert.equal(40, d.totalFeatureCount);
		});
	});
 
	describe('NonOverlappingLayout', function() {
		var layout = new NonOverlappingLayout(data.domainsAndSites.features, 40);
 
		it('should calculate track overlapps', function() {
			layout.calculate();
		});
 
		it('should return feature height', function() {
			assert.equal(13,layout.getFeatureHeight());
		});
 
		it('should return right number of rows', function() {
			assert.equal(2, layout.getRows().length);
		});
	});
 
});