mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-16 18:54:12 +01:00
Add unit tests to check that 'fill:none' is being set by default.
Updated unit tests to include 'fill:none' in expect style array values.
This commit is contained in:
@@ -150,7 +150,7 @@ describe('when using mermaid and ',function() {
|
|||||||
expect(start).toBe('A');
|
expect(start).toBe('A');
|
||||||
expect(end).toBe('B');
|
expect(end).toBe('B');
|
||||||
expect(options.arrowhead).toBe('none');
|
expect(options.arrowhead).toBe('none');
|
||||||
expect(options.style).toBe('stroke:val1;stroke-width:val2;');
|
expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -183,7 +183,40 @@ describe('when using mermaid and ',function() {
|
|||||||
expect(end).toBe('B');
|
expect(end).toBe('B');
|
||||||
expect(options.arrowhead).toBe('none');
|
expect(options.arrowhead).toBe('none');
|
||||||
expect(options.label.match('the text')).toBeTruthy();
|
expect(options.label.match('the text')).toBeTruthy();
|
||||||
expect(options.style).toBe('stroke:val1;stroke-width:val2;');
|
expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
flowRend.addEdges(edges,mockG);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set fill to "none" by default when handling edges', function () {
|
||||||
|
flow.parser.parse('graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2;');
|
||||||
|
flow.parser.yy.getVertices();
|
||||||
|
var edges = flow.parser.yy.getEdges();
|
||||||
|
|
||||||
|
var mockG = {
|
||||||
|
setEdge:function(start, end,options){
|
||||||
|
expect(start).toBe('A');
|
||||||
|
expect(end).toBe('B');
|
||||||
|
expect(options.arrowhead).toBe('none');
|
||||||
|
expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
flowRend.addEdges(edges,mockG);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not set fill to none if fill is set in linkStyle', function () {
|
||||||
|
flow.parser.parse('graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2,fill:blue;');
|
||||||
|
flow.parser.yy.getVertices();
|
||||||
|
var edges = flow.parser.yy.getEdges();
|
||||||
|
var mockG = {
|
||||||
|
setEdge:function(start, end,options){
|
||||||
|
expect(start).toBe('A');
|
||||||
|
expect(end).toBe('B');
|
||||||
|
expect(options.arrowhead).toBe('none');
|
||||||
|
expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:blue;');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user