2017-04-11 22:57:57 +08:00
|
|
|
/* eslint-env jasmine */
|
2015-02-08 20:07:15 +01:00
|
|
|
/**
|
|
|
|
* Created by knut on 14-11-18.
|
|
|
|
*/
|
2017-04-11 22:14:25 +08:00
|
|
|
describe('when parsing a gantt diagram it', function () {
|
|
|
|
var gantt
|
|
|
|
beforeEach(function () {
|
|
|
|
gantt = require('./parser/gantt').parser
|
|
|
|
gantt.yy = require('./ganttDb')
|
|
|
|
|
|
|
|
// 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 () {
|
|
|
|
var str = 'gantt\ndateFormat yyyy-mm-dd\ntitle Adding gantt diagram functionality to mermaid'
|
|
|
|
|
|
|
|
gantt.parse(str)
|
|
|
|
})
|
|
|
|
it('should handle an dateFormat definition', function () {
|
|
|
|
var str = 'gantt\ndateFormat yyyy-mm-dd\ntitle Adding gantt diagram functionality to mermaid'
|
|
|
|
|
|
|
|
gantt.parse(str)
|
|
|
|
})
|
|
|
|
it('should handle an section definition', function () {
|
|
|
|
var str = 'gantt\ndateFormat yyyy-mm-dd\ntitle Adding gantt diagram functionality to mermaid'
|
|
|
|
|
|
|
|
gantt.parse(str)
|
|
|
|
})
|
2015-06-30 14:23:32 +02:00
|
|
|
/**
|
2017-04-11 22:14:25 +08:00
|
|
|
* Beslutsflöde inligt nedan. Obs bla bla bla
|
2015-06-30 14:23:32 +02:00
|
|
|
* ```
|
|
|
|
* graph TD
|
|
|
|
* A[Hard pledge] -- text on link -->B(Round edge)
|
|
|
|
* B --> C{to do or not to do}
|
|
|
|
* C -->|Too| D[Result one]
|
|
|
|
* C -->|Doo| E[Result two]
|
2017-04-11 22:14:25 +08:00
|
|
|
```
|
2015-06-30 14:23:32 +02:00
|
|
|
* params bapa - a unique bapap
|
|
|
|
*/
|
2017-04-11 22:14:25 +08:00
|
|
|
it('should handle a task definition', function () {
|
|
|
|
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' +
|
2017-04-11 22:14:25 +08:00
|
|
|
'Design jison grammar:des1, 2014-01-01, 2014-01-04'
|
2015-02-08 20:07:15 +01:00
|
|
|
|
2017-04-11 22:14:25 +08:00
|
|
|
gantt.parse(str)
|
|
|
|
})
|
|
|
|
})
|
2015-02-08 20:07:15 +01:00
|
|
|
|
|
|
|
// Ogiltigt id i after id
|