2015-02-08 20:07:15 +01:00
|
|
|
/**
|
|
|
|
* Created by knut on 14-11-18.
|
|
|
|
*/
|
|
|
|
describe('when parsing a gantt diagram it',function() {
|
|
|
|
var parseError, gantt;
|
|
|
|
beforeEach(function () {
|
|
|
|
gantt = require('./parser/gantt').parser;
|
|
|
|
gantt.yy = require('./ganttDb');
|
|
|
|
parseError = function(err, hash) {
|
|
|
|
console.log('Syntax error:' + err);
|
|
|
|
};
|
|
|
|
//ex.yy.parseError = parseError;
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle an dateFormat definition', function () {
|
|
|
|
var str = 'gantt\ndateFormat yyyy-mm-dd';
|
|
|
|
|
|
|
|
gantt.parse(str);
|
|
|
|
});
|
|
|
|
it('should handle an dateFormat definition', function () {
|
2015-02-28 23:50:23 +01:00
|
|
|
var str = 'gantt\ndateFormat yyyy-mm-dd\ntitle Adding gantt diagram functionality to mermaid';
|
2015-02-08 20:07:15 +01:00
|
|
|
|
|
|
|
gantt.parse(str);
|
|
|
|
});
|
|
|
|
it('should handle an dateFormat definition', function () {
|
2015-02-28 23:50:23 +01:00
|
|
|
var str = 'gantt\ndateFormat yyyy-mm-dd\ntitle Adding gantt diagram functionality to mermaid';
|
2015-02-08 20:07:15 +01:00
|
|
|
|
|
|
|
gantt.parse(str);
|
|
|
|
});
|
2015-02-28 23:50:23 +01:00
|
|
|
it('should handle an section definition', function () {
|
|
|
|
var str = 'gantt\ndateFormat yyyy-mm-dd\ntitle Adding gantt diagram functionality to mermaid';
|
2015-02-08 20:07:15 +01:00
|
|
|
|
|
|
|
gantt.parse(str);
|
|
|
|
});
|
2015-02-28 23:50:23 +01:00
|
|
|
it('should handle a task definition', function () {
|
2015-02-08 20:07:15 +01:00
|
|
|
var str = 'gantt\n' +
|
2015-02-28 23:50:23 +01:00
|
|
|
'dateFormat yyyy-mm-dd\n' +
|
|
|
|
'title Adding gantt diagram functionality to mermaid\n' +
|
2015-02-08 20:07:15 +01:00
|
|
|
'section Documentation\n' +
|
|
|
|
'Design jison grammar:des1, 2014-01-01, 2014-01-04';
|
|
|
|
|
|
|
|
gantt.parse(str);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// Ogiltigt id i after id
|