mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 23:39:50 +02:00
#530 Finished basic unit tests for flow shapes
This commit is contained in:
@@ -18,20 +18,14 @@ describe('flowchart shapes', function() {
|
|||||||
function(w, h) {
|
function(w, h) {
|
||||||
return w + h / 2;
|
return w + h / 2;
|
||||||
},
|
},
|
||||||
function(w, h) {
|
useHeight
|
||||||
return h;
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
[
|
['rect_left_inv_arrow', 5, useWidth, useHeight],
|
||||||
'rect_left_inv_arrow',
|
['rect_right_inv_arrow', 5, useWidth, useHeight],
|
||||||
5,
|
['lean_right', 4, useWidth, useHeight],
|
||||||
function(w) {
|
['lean_left', 4, useWidth, useHeight],
|
||||||
return w;
|
['trapezoid', 4, useWidth, useHeight],
|
||||||
},
|
['inv_trapezoid', 4, useWidth, useHeight]
|
||||||
function(w, h) {
|
|
||||||
return h;
|
|
||||||
}
|
|
||||||
]
|
|
||||||
].forEach(function([shapeType, expectedPointCount, getW, getH]) {
|
].forEach(function([shapeType, expectedPointCount, getW, getH]) {
|
||||||
it(`should add a ${shapeType} shape that renders a properly translated polygon element`, function() {
|
it(`should add a ${shapeType} shape that renders a properly translated polygon element`, function() {
|
||||||
const mockRender = MockRender();
|
const mockRender = MockRender();
|
||||||
@@ -87,3 +81,11 @@ function MockSvg(tag, ...args) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function useWidth(w, h) {
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
function useHeight(w, h) {
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user