spelling: label

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref
2025-04-17 08:05:57 -04:00
parent 2aeb435f19
commit 873962c739
2 changed files with 10 additions and 10 deletions

View File

@@ -1080,7 +1080,7 @@ end
it('should be possible to use @ syntax to add labels on multi nodes', () => { it('should be possible to use @ syntax to add labels on multi nodes', () => {
imgSnapshotTest( imgSnapshotTest(
`flowchart TB `flowchart TB
n2["label for n2"] & n4@{ label: "labe for n4"} & n5@{ label: "labe for n5"} n2["label for n2"] & n4@{ label: "label for n4"} & n5@{ label: "label for n5"}
`, `,
{} {}
); );
@@ -1088,7 +1088,7 @@ end
it('should be possible to use @ syntax to add labels with trail spaces and &', () => { it('should be possible to use @ syntax to add labels with trail spaces and &', () => {
imgSnapshotTest( imgSnapshotTest(
`flowchart TB `flowchart TB
n2["label for n2"] & n4@{ label: "labe for n4"} & n5@{ label: "labe for n5"} n2["label for n2"] & n4@{ label: "label for n4"} & n5@{ label: "label for n5"}
`, `,
{} {}
); );
@@ -1097,8 +1097,8 @@ end
imgSnapshotTest( imgSnapshotTest(
`flowchart TB `flowchart TB
n2["label for n2"] n2["label for n2"]
n4@{ label: "labe for n4"} n4@{ label: "label for n4"}
n5@{ label: "labe for n5"} n5@{ label: "label for n5"}
`, `,
{} {}
); );

View File

@@ -293,14 +293,14 @@ describe('when parsing directions', function () {
it('should be possible to use @ syntax to add labels on multi nodes', function () { it('should be possible to use @ syntax to add labels on multi nodes', function () {
const res = flow.parser.parse(`flowchart TB const res = flow.parser.parse(`flowchart TB
n2["label for n2"] & n4@{ label: "labe for n4"} & n5@{ label: "labe for n5"} n2["label for n2"] & n4@{ label: "label for n4"} & n5@{ label: "label for n5"}
`); `);
const data4Layout = flow.parser.yy.getData(); const data4Layout = flow.parser.yy.getData();
expect(data4Layout.nodes.length).toBe(3); expect(data4Layout.nodes.length).toBe(3);
expect(data4Layout.nodes[0].label).toEqual('label for n2'); expect(data4Layout.nodes[0].label).toEqual('label for n2');
expect(data4Layout.nodes[1].label).toEqual('labe for n4'); expect(data4Layout.nodes[1].label).toEqual('label for n4');
expect(data4Layout.nodes[2].label).toEqual('labe for n5'); expect(data4Layout.nodes[2].label).toEqual('label for n5');
}); });
it('should be possible to use @ syntax to add labels on multi nodes with edge/link', function () { it('should be possible to use @ syntax to add labels on multi nodes with edge/link', function () {
@@ -403,13 +403,13 @@ describe('when parsing directions', function () {
it.skip('should be possible to use @ syntax to add labels with trail spaces', function () { it.skip('should be possible to use @ syntax to add labels with trail spaces', function () {
const res = flow.parser.parse( const res = flow.parser.parse(
`flowchart TB `flowchart TB
n2["label for n2"] & n4@{ label: "labe for n4"} & n5@{ label: "labe for n5"} ` n2["label for n2"] & n4@{ label: "label for n4"} & n5@{ label: "label for n5"} `
); );
const data4Layout = flow.parser.yy.getData(); const data4Layout = flow.parser.yy.getData();
expect(data4Layout.nodes.length).toBe(3); expect(data4Layout.nodes.length).toBe(3);
expect(data4Layout.nodes[0].label).toEqual('label for n2'); expect(data4Layout.nodes[0].label).toEqual('label for n2');
expect(data4Layout.nodes[1].label).toEqual('labe for n4'); expect(data4Layout.nodes[1].label).toEqual('label for n4');
expect(data4Layout.nodes[2].label).toEqual('labe for n5'); expect(data4Layout.nodes[2].label).toEqual('label for n5');
}); });
}); });