Code coverage report for src/utils.spec.js

Statements: 3.7% (1 / 27)      Branches: 100% (0 / 0)      Functions: 0% (0 / 8)      Lines: 3.7% (1 / 27)      Ignored: none     

All files » src/ » utils.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 39 40 41 42 43 44 45 46 47 48 49        1                                                                                        
/**
 * Created by knut on 14-11-23.
 */
 
describe('when detecting chart type ',function() {
    var utils = require('./utils');
    beforeEach(function () {
 
    });
 
    it('should handle a sequence defintion', function () {
        str = 'sequence TB\nbfs1:queue';
 
        var type = utils.detectType(str);
        expect(type).toBe('sequence');
    });
    it('should handle a sequence defintion with leading spaces', function () {
        str = '    sequence TB\nbfs1:queue';
 
        var type = utils.detectType(str);
        expect(type).toBe('sequence');
    });
 
    it('should handle a graph defintion', function () {
        str = 'graph TB\nbfs1:queue';
 
        var type = utils.detectType(str);
        expect(type).toBe('graph');
    });
    it('should handle a graph defintion with leading spaces', function () {
        str = '    graph TB\nbfs1:queue';
 
        var type = utils.detectType(str);
        expect(type).toBe('graph');
    });
 
    it('should handle a graph defintion with leading spaces and newline', function () {
        str = '  \n  graph TB\nbfs1:queue';
 
        var type = utils.detectType(str);
        expect(type).toBe('graph');
    });
    it('should handle a sequence defintion with leading spaces and newline', function () {
        str = '  \n  sequence TB\nbfs1:queue';
 
        var type = utils.detectType(str);
        expect(type).toBe('sequence');
    });
});