mermaid/src/diagrams/gantt/gantt.spec.js

57 lines
1.6 KiB
JavaScript
Raw Normal View History

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)
})
/**
2017-04-11 22:14:25 +08:00
* Beslutsflöde inligt nedan. Obs bla bla bla
* ```
* 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
```
* params bapa - a unique bapap
*/
2017-04-11 22:14:25 +08:00
it('should handle a task definition', function () {
var str = 'gantt\n' +
'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