Skip to content

Commit b1b1f20

Browse files
refactor: add semantiId to AID forms (#1162)
1 parent 8554b5c commit b1b1f20

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

packages/td-tools/src/util/asset-interface-description.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,7 @@ export class AssetInterfaceDescriptionUtil {
14281428

14291429
propertyValues.push({
14301430
idShort: "forms",
1431+
semanticId: this.createSemanticId("https://www.w3.org/2019/wot/td#hasForm"),
14311432
value: propertyForm,
14321433
modelType: "SubmodelElementCollection",
14331434
});

packages/td-tools/test/AssetInterfaceDescriptionTest.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,13 @@ class AssetInterfaceDescriptionUtilTest {
571571
.to.be.an("object")
572572
.with.property("keys")
573573
.to.be.an("array")
574-
.to.have.lengthOf.greaterThan(0);
574+
.to.have.lengthOf.greaterThan(0)
575+
.to.have.deep.members([
576+
{
577+
type: "GlobalReference",
578+
value: "https://admin-shell.io/idta/AssetInterfacesDescription/1/0/Interface",
579+
},
580+
]);
575581
expect(smInterface)
576582
.to.have.property("supplementalSemanticIds")
577583
.to.be.an("array")
@@ -708,6 +714,18 @@ class AssetInterfaceDescriptionUtilTest {
708714
.to.have.property("value")
709715
.to.be.an("array")
710716
.to.have.lengthOf.greaterThan(0);
717+
expect(propProperty)
718+
.to.have.property("semanticId")
719+
.to.be.an("object")
720+
.with.property("keys")
721+
.to.be.an("array")
722+
.to.have.lengthOf.greaterThan(0)
723+
.to.have.deep.members([
724+
{
725+
type: "GlobalReference",
726+
value: "https://www.w3.org/2019/wot/td#hasForm",
727+
},
728+
]);
711729
let hasHref = false;
712730
let hasContentType = false;
713731
let hasHtvMethodName = false;

0 commit comments

Comments
 (0)