mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-17 19:24:10 +01:00
Update after lint comments
This commit is contained in:
20
src/setupGraphViewbox.spec.js
Normal file
20
src/setupGraphViewbox.spec.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import utils from './utils';
|
||||
import assignWithDepth from './assignWithDepth';
|
||||
import { detectType } from './diagram-api/detectType';
|
||||
import { addDiagrams } from './diagram-api/diagram-orchestration';
|
||||
import { calculateSvgSizeAttrs } from './setupGraphViewbox';
|
||||
addDiagrams();
|
||||
|
||||
describe('when calculating SVG size', function () {
|
||||
it('should return width 100% when useMaxWidth is true', function () {
|
||||
const attrs = calculateSvgSizeAttrs(100, 200, true);
|
||||
// expect(attrs.get('height')).toEqual(100);
|
||||
expect(attrs.get('style')).toEqual('max-width: 200px;');
|
||||
expect(attrs.get('width')).toEqual('100%');
|
||||
});
|
||||
it('should return absolute width when useMaxWidth is false', function () {
|
||||
const attrs = calculateSvgSizeAttrs(100, 200, false);
|
||||
// expect(attrs.get('height')).toEqual(100);
|
||||
expect(attrs.get('width')).toEqual(200);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user