2023-07-05 12:01:37 +02:00
|
|
|
// @ts-ignore: jison doesn't export types
|
2023-07-07 12:58:30 +02:00
|
|
|
import block from './block.jison';
|
2023-07-05 12:01:37 +02:00
|
|
|
import db from '../blockDB.js';
|
|
|
|
import { cleanupComments } from '../../../diagram-api/comments.js';
|
2023-07-07 12:58:30 +02:00
|
|
|
import { prepareTextForParsing } from '../blockUtils.js';
|
2023-08-28 12:51:49 +02:00
|
|
|
import { setConfig } from '../../../config.js';
|
2023-07-05 12:01:37 +02:00
|
|
|
|
2023-07-10 22:33:11 +02:00
|
|
|
describe('Block diagram', function () {
|
2023-07-05 12:01:37 +02:00
|
|
|
describe('when parsing an block diagram graph it should handle > ', function () {
|
|
|
|
beforeEach(function () {
|
2023-07-07 12:58:30 +02:00
|
|
|
block.parser.yy = db;
|
|
|
|
block.parser.yy.clear();
|
|
|
|
block.parser.yy.getLogger = () => console;
|
2023-07-05 12:01:37 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
it('a diagram with a node', async () => {
|
2023-07-07 12:58:30 +02:00
|
|
|
const str = `block-beta
|
2023-07-05 12:01:37 +02:00
|
|
|
id
|
|
|
|
`;
|
|
|
|
|
2023-07-07 12:58:30 +02:00
|
|
|
block.parse(str);
|
2023-08-28 12:51:49 +02:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].id).toBe('id');
|
2023-08-28 12:51:49 +02:00
|
|
|
expect(blocks[0].label).toBe('id');
|
|
|
|
});
|
|
|
|
it('a node with a square shape and a label', async () => {
|
|
|
|
const str = `block-beta
|
|
|
|
id["A label"]
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].id).toBe('id');
|
2023-08-28 12:51:49 +02:00
|
|
|
expect(blocks[0].label).toBe('A label');
|
|
|
|
expect(blocks[0].type).toBe('square');
|
2023-07-05 12:01:37 +02:00
|
|
|
});
|
|
|
|
it('a diagram with multiple nodes', async () => {
|
2023-07-07 12:58:30 +02:00
|
|
|
const str = `block-beta
|
2023-07-05 12:01:37 +02:00
|
|
|
id1
|
|
|
|
id2
|
|
|
|
`;
|
|
|
|
|
2023-07-07 12:58:30 +02:00
|
|
|
block.parse(str);
|
2023-09-01 14:06:13 +02:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(2);
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].id).toBe('id1');
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[0].label).toBe('id1');
|
2024-01-18 14:28:14 +01:00
|
|
|
expect(blocks[0].type).toBe('na');
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[1].id).toBe('id2');
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[1].label).toBe('id2');
|
2024-01-18 14:28:14 +01:00
|
|
|
expect(blocks[1].type).toBe('na');
|
2023-07-05 12:01:37 +02:00
|
|
|
});
|
2023-07-09 12:28:14 +02:00
|
|
|
it('a diagram with multiple nodes', async () => {
|
|
|
|
const str = `block-beta
|
|
|
|
id1
|
|
|
|
id2
|
|
|
|
id3
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2023-09-01 14:06:13 +02:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(3);
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].id).toBe('id1');
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[0].label).toBe('id1');
|
2024-01-18 14:28:14 +01:00
|
|
|
expect(blocks[0].type).toBe('na');
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[1].id).toBe('id2');
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[1].label).toBe('id2');
|
2024-01-18 14:28:14 +01:00
|
|
|
expect(blocks[1].type).toBe('na');
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[2].id).toBe('id3');
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[2].label).toBe('id3');
|
2024-01-18 14:28:14 +01:00
|
|
|
expect(blocks[2].type).toBe('na');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
|
|
|
|
2023-07-05 12:01:37 +02:00
|
|
|
it('a node with a square shape and a label', async () => {
|
2023-07-07 12:58:30 +02:00
|
|
|
const str = `block-beta
|
2023-07-05 12:01:37 +02:00
|
|
|
id["A label"]
|
|
|
|
id2`;
|
|
|
|
|
2023-07-07 12:58:30 +02:00
|
|
|
block.parse(str);
|
2023-09-01 14:06:13 +02:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(2);
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].id).toBe('id');
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[0].label).toBe('A label');
|
|
|
|
expect(blocks[0].type).toBe('square');
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[1].id).toBe('id2');
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[1].label).toBe('id2');
|
2024-01-18 14:28:14 +01:00
|
|
|
expect(blocks[1].type).toBe('na');
|
2023-07-05 12:01:37 +02:00
|
|
|
});
|
2024-01-18 15:31:14 +01:00
|
|
|
it('a diagram with multiple nodes with edges abc123', async () => {
|
2023-07-07 12:58:30 +02:00
|
|
|
const str = `block-beta
|
2023-07-05 12:01:37 +02:00
|
|
|
id1["first"] --> id2["second"]
|
|
|
|
`;
|
|
|
|
|
2023-07-07 12:58:30 +02:00
|
|
|
block.parse(str);
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
const edges = db.getEdges();
|
|
|
|
expect(blocks.length).toBe(2);
|
|
|
|
expect(edges.length).toBe(1);
|
|
|
|
expect(edges[0].start).toBe('id1');
|
|
|
|
expect(edges[0].end).toBe('id2');
|
|
|
|
expect(edges[0].arrowTypeEnd).toBe('arrow_point');
|
|
|
|
});
|
|
|
|
it('a diagram with multiple nodes with edges abc123', async () => {
|
|
|
|
const str = `block-beta
|
|
|
|
id1["first"] -- "a label" --> id2["second"]
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
const edges = db.getEdges();
|
|
|
|
expect(blocks.length).toBe(2);
|
|
|
|
expect(edges.length).toBe(1);
|
|
|
|
expect(edges[0].start).toBe('id1');
|
|
|
|
expect(edges[0].end).toBe('id2');
|
|
|
|
expect(edges[0].arrowTypeEnd).toBe('arrow_point');
|
|
|
|
expect(edges[0].label).toBe('a label');
|
2023-07-05 12:01:37 +02:00
|
|
|
});
|
2023-08-08 15:56:02 +02:00
|
|
|
it('a diagram with column statements', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
2023-08-08 15:56:02 +02:00
|
|
|
columns 2
|
2023-07-09 12:28:14 +02:00
|
|
|
block1["Block 1"]
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2023-08-08 15:56:02 +02:00
|
|
|
expect(db.getColumns('root')).toBe(2);
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2023-08-08 15:56:02 +02:00
|
|
|
it('a diagram withput column statements', async () => {
|
|
|
|
const str = `block-beta
|
|
|
|
block1["Block 1"]
|
|
|
|
`;
|
2023-07-09 12:28:14 +02:00
|
|
|
|
2023-08-08 15:56:02 +02:00
|
|
|
block.parse(str);
|
|
|
|
expect(db.getColumns('root')).toBe(-1);
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
2023-08-08 15:56:02 +02:00
|
|
|
});
|
|
|
|
it('a diagram with auto column statements', async () => {
|
|
|
|
const str = `block-beta
|
|
|
|
columns auto
|
|
|
|
block1["Block 1"]
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
|
|
|
expect(db.getColumns('root')).toBe(-1);
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
2023-08-08 15:56:02 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
it('blocks next to each other', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
|
|
|
columns 2
|
|
|
|
block1["Block 1"]
|
|
|
|
block2["Block 2"]
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
|
|
|
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(db.getColumns('root')).toBe(2);
|
|
|
|
expect(blocks.length).toBe(2);
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
|
|
|
|
2023-08-08 15:56:02 +02:00
|
|
|
it('blocks on top of each other', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
|
|
|
columns 1
|
|
|
|
block1["Block 1"]
|
|
|
|
block2["Block 2"]
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
|
|
|
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(db.getColumns('root')).toBe(1);
|
|
|
|
expect(blocks.length).toBe(2);
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
|
|
|
|
2023-09-01 14:06:13 +02:00
|
|
|
it('compound blocks 2', async () => {
|
2023-08-08 15:56:02 +02:00
|
|
|
const str = `block-beta
|
2023-07-09 12:28:14 +02:00
|
|
|
block
|
2023-09-01 15:33:38 +02:00
|
|
|
aBlock["ABlock"]
|
|
|
|
bBlock["BBlock"]
|
2023-09-01 14:06:13 +02:00
|
|
|
end
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
2023-09-01 15:33:38 +02:00
|
|
|
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(blocks[0].children.length).toBe(2);
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].id).not.toBe(undefined);
|
2023-10-20 12:30:25 +02:00
|
|
|
expect(blocks[0].label).toBe('');
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].type).toBe('composite');
|
|
|
|
|
|
|
|
const aBlock = blocks[0].children[0];
|
|
|
|
|
|
|
|
expect(aBlock.id).not.toBe(aBlock);
|
|
|
|
expect(aBlock.label).toBe('ABlock');
|
|
|
|
expect(aBlock.type).toBe('square');
|
|
|
|
|
|
|
|
const bBlock = blocks[0].children[1];
|
|
|
|
expect(bBlock.id).not.toBe(bBlock);
|
|
|
|
expect(bBlock.label).toBe('BBlock');
|
|
|
|
expect(bBlock.type).toBe('square');
|
2023-09-01 14:06:13 +02:00
|
|
|
});
|
2023-09-01 15:33:38 +02:00
|
|
|
it('compound blocks of compound blocks', async () => {
|
2023-09-01 14:06:13 +02:00
|
|
|
const str = `block-beta
|
|
|
|
block
|
|
|
|
aBlock["ABlock"]
|
|
|
|
block
|
|
|
|
bBlock["BBlock"]
|
|
|
|
end
|
2023-08-08 15:56:02 +02:00
|
|
|
end
|
2023-07-09 12:28:14 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2023-09-01 14:06:13 +02:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
|
2023-09-01 15:33:38 +02:00
|
|
|
const aBlock = blocks[0].children[0];
|
|
|
|
const secondComposite = blocks[0].children[1];
|
|
|
|
const bBlock = blocks[0].children[1].children[0];
|
2023-09-01 14:06:13 +02:00
|
|
|
|
|
|
|
expect(blocks[0].children.length).toBe(2);
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].id).not.toBe(undefined);
|
2023-10-20 12:30:25 +02:00
|
|
|
expect(blocks[0].label).toBe('');
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(blocks[0].type).toBe('composite');
|
2023-09-01 14:06:13 +02:00
|
|
|
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(secondComposite.children.length).toBe(1);
|
|
|
|
expect(secondComposite.id).not.toBe(undefined);
|
2023-10-20 12:30:25 +02:00
|
|
|
expect(secondComposite.label).toBe('');
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(secondComposite.type).toBe('composite');
|
2023-09-01 14:06:13 +02:00
|
|
|
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(aBlock.id).not.toBe(aBlock);
|
|
|
|
expect(aBlock.label).toBe('ABlock');
|
|
|
|
expect(aBlock.type).toBe('square');
|
2023-09-01 14:06:13 +02:00
|
|
|
|
2023-09-01 15:33:38 +02:00
|
|
|
expect(bBlock.id).not.toBe(bBlock);
|
2023-09-01 14:06:13 +02:00
|
|
|
expect(bBlock.label).toBe('BBlock');
|
|
|
|
expect(bBlock.type).toBe('square');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2023-09-01 15:33:38 +02:00
|
|
|
it('compound blocks with title', async () => {
|
|
|
|
const str = `block-beta
|
2023-09-01 16:22:23 +02:00
|
|
|
block:compoundBlock["Compound block"]
|
2023-07-09 12:28:14 +02:00
|
|
|
columns 1
|
2023-09-01 16:22:23 +02:00
|
|
|
block2["Block 2"]
|
2023-07-09 12:28:14 +02:00
|
|
|
end
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2023-09-01 16:22:23 +02:00
|
|
|
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
|
|
|
|
|
|
|
const compoundBlock = blocks[0];
|
|
|
|
const block2 = compoundBlock.children[0];
|
|
|
|
|
|
|
|
expect(compoundBlock.children.length).toBe(1);
|
|
|
|
expect(compoundBlock.id).toBe('compoundBlock');
|
|
|
|
expect(compoundBlock.label).toBe('Compound block');
|
2024-01-18 14:28:14 +01:00
|
|
|
expect(compoundBlock.type).toBe('composite');
|
2023-09-01 16:22:23 +02:00
|
|
|
|
|
|
|
expect(block2.id).toBe('block2');
|
|
|
|
expect(block2.label).toBe('Block 2');
|
|
|
|
expect(block2.type).toBe('square');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2024-01-18 14:28:14 +01:00
|
|
|
it('blocks mixed with compound blocks', async () => {
|
|
|
|
const str = `block-beta
|
2023-07-09 12:28:14 +02:00
|
|
|
columns 1
|
|
|
|
block1["Block 1"]
|
|
|
|
|
|
|
|
block
|
|
|
|
columns 2
|
|
|
|
block2["Block 2"]
|
|
|
|
block3["Block 3"]
|
2023-08-08 15:56:02 +02:00
|
|
|
end
|
2023-07-09 12:28:14 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2024-01-18 14:28:14 +01:00
|
|
|
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(2);
|
|
|
|
|
|
|
|
const compoundBlock = blocks[1];
|
|
|
|
const block2 = compoundBlock.children[0];
|
|
|
|
|
|
|
|
expect(compoundBlock.children.length).toBe(2);
|
|
|
|
|
|
|
|
expect(block2.id).toBe('block2');
|
|
|
|
expect(block2.label).toBe('Block 2');
|
|
|
|
expect(block2.type).toBe('square');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
|
|
|
|
2024-01-18 14:28:14 +01:00
|
|
|
it('Arrow blocks', async () => {
|
|
|
|
const str = `block-beta
|
2023-07-09 12:28:14 +02:00
|
|
|
columns 3
|
|
|
|
block1["Block 1"]
|
2024-01-18 14:28:14 +01:00
|
|
|
blockArrow<[" "]>(right)
|
2023-07-09 12:28:14 +02:00
|
|
|
block2["Block 2"]`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2024-01-18 14:28:14 +01:00
|
|
|
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(3);
|
|
|
|
|
|
|
|
const block1 = blocks[0];
|
|
|
|
const blockArrow = blocks[1];
|
|
|
|
const block2 = blocks[2];
|
|
|
|
|
|
|
|
expect(block1.id).toBe('block1');
|
|
|
|
expect(blockArrow.id).toBe('blockArrow');
|
|
|
|
expect(block2.id).toBe('block2');
|
|
|
|
expect(block2.label).toBe('Block 2');
|
|
|
|
expect(block2.type).toBe('square');
|
|
|
|
expect(blockArrow.type).toBe('block_arrow');
|
2024-01-18 15:31:14 +01:00
|
|
|
expect(blockArrow.directions).toContain('right');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2024-01-18 15:31:14 +01:00
|
|
|
it('Arrow blocks with multiple points', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
|
|
|
columns 1
|
|
|
|
A
|
2024-01-18 15:31:14 +01:00
|
|
|
blockArrow<[" "]>(up, down)
|
2023-07-09 12:28:14 +02:00
|
|
|
block
|
|
|
|
columns 3
|
|
|
|
B
|
|
|
|
C
|
|
|
|
D
|
|
|
|
end`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2024-01-18 15:31:14 +01:00
|
|
|
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(3);
|
|
|
|
|
|
|
|
const blockArrow = blocks[1];
|
|
|
|
expect(blockArrow.type).toBe('block_arrow');
|
|
|
|
expect(blockArrow.directions).toContain('up');
|
|
|
|
expect(blockArrow.directions).toContain('down');
|
|
|
|
expect(blockArrow.directions).not.toContain('right');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2024-01-18 14:28:14 +01:00
|
|
|
it('blocks with different widths', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
|
|
|
columns 3
|
|
|
|
one["One Slot"]
|
|
|
|
two["Two slots"]:2
|
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2024-01-18 14:28:14 +01:00
|
|
|
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(2);
|
|
|
|
const one = blocks[0];
|
|
|
|
const two = blocks[1];
|
2024-01-30 16:05:16 +01:00
|
|
|
expect(two.widthInColumns).toBe(2);
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2023-10-20 12:30:25 +02:00
|
|
|
it('empty blocks', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
|
|
|
columns 3
|
|
|
|
space
|
|
|
|
middle["In the middle"]
|
2024-01-18 15:31:14 +01:00
|
|
|
space
|
2023-07-09 12:28:14 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2024-01-18 15:31:14 +01:00
|
|
|
|
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(3);
|
|
|
|
const sp1 = blocks[0];
|
|
|
|
const middle = blocks[1];
|
|
|
|
const sp2 = blocks[2];
|
|
|
|
expect(sp1.type).toBe('space');
|
|
|
|
expect(sp2.type).toBe('space');
|
|
|
|
expect(middle.label).toBe('In the middle');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2024-01-18 15:31:14 +01:00
|
|
|
it('classDef statements applied to a block', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
|
|
|
classDef black color:#ffffff, fill:#000000;
|
|
|
|
|
2024-01-18 15:31:14 +01:00
|
|
|
mc["Memcache"]
|
|
|
|
class mc black
|
2023-07-09 12:28:14 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
|
|
|
const mc = blocks[0];
|
|
|
|
expect(mc.classes).toContain('black');
|
|
|
|
const classes = db.getClasses();
|
|
|
|
const black = classes.black;
|
|
|
|
expect(black.id).toBe('black');
|
|
|
|
expect(black.styles[0]).toEqual('color:#ffffff');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2024-01-18 15:31:14 +01:00
|
|
|
it('style statements applied to a block', async () => {
|
2023-07-09 12:28:14 +02:00
|
|
|
const str = `block-beta
|
2024-01-18 15:31:14 +01:00
|
|
|
columns 1
|
|
|
|
B["A wide one in the middle"]
|
|
|
|
style B fill:#f9F,stroke:#333,stroke-width:4px
|
2023-07-09 12:28:14 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
block.parse(str);
|
2024-01-18 15:31:14 +01:00
|
|
|
const blocks = db.getBlocks();
|
|
|
|
expect(blocks.length).toBe(1);
|
|
|
|
const B = blocks[0];
|
|
|
|
expect(B.styles).toContain('fill:#f9F');
|
2023-07-09 12:28:14 +02:00
|
|
|
});
|
2023-07-05 12:01:37 +02:00
|
|
|
});
|
|
|
|
});
|