## Work in progress.

Implemented directives per PR review comment:

%%{directive: json-encoded-arg-string}%%

example:

%%{init: { 'logLevel': 0, 'theme': 'dark' }}%%

Also changed wrap and config to directives:

%%{wrap}%%
%%{config: { 'fontSize': 18 }}%%
This commit is contained in:
Chris Moran
2020-06-11 15:31:59 -04:00
parent dba617a7fe
commit 04b4da0c75
18 changed files with 1619 additions and 845 deletions

View File

@@ -8,12 +8,19 @@ describe('when detecting chart type ', function() {
expect(type).toBe('flowchart');
});
it('should handle an initialize defintion', function() {
const str = 'initialize: { "logLevel": 0, "theme": "dark" }\ngraph TB\nbfs1:queue';
const str = `
%%{initialize: { 'logLevel': 0, 'theme': 'dark' }}%%
graph TB
bfs1:queue
`;
const init = JSON.stringify(utils.detectInit(str));
expect(init).toBe('{"logLevel":0,"theme":"dark"}');
});
it('should handle an init defintion', function() {
const str = 'init: { "logLevel": 0, "theme": "dark" }\ngraph TB\nbfs1:queue';
const str = `
%%{init: { 'logLevel': 0, 'theme': 'dark' }}%%
graph TB
bfs1:queue`;
const init = JSON.stringify(utils.detectInit(str));
expect(init).toBe('{"logLevel":0,"theme":"dark"}');
});