Skip to content

Commit 7f8208d

Browse files
committed
Additional tests for Lionweb trace nodes
1 parent 2c6e296 commit 7f8208d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/model/model.ts

+4
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ export abstract class Node extends Origin implements Destination {
343343
set position(newPos: Position | undefined) {
344344
this.positionOverride = newPos;
345345
}
346+
347+
get sourceText(): string | undefined {
348+
return this.origin?.sourceText;
349+
}
346350
}
347351

348352
export interface FeatureDescription {

tests/interop/lionweb.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ describe('Lionweb integration', function() {
103103
const root = nodes[0];
104104
expect(root.node).to.be.instanceof(LionwebNode);
105105
let dir = new TraceNode(root.node as LionwebNode);
106+
expect(dir.nodeDefinition).not.to.be.undefined;
106107
expect(dir.getRole()).to.be.undefined;
107108
expect(dir.nodeDefinition.name).to.equal("Directory");
109+
expect(dir.containment("position")).to.be.undefined;
108110
expect(dir.getAttributeValue("name")).to.equal("resources.zip");
109111
expect(dir.getChildren("files").length).to.equal(1);
110112
dir = dir.getChildren("files")[0];

0 commit comments

Comments
 (0)