Skip to content

Commit

Permalink
Check ref content.
Browse files Browse the repository at this point in the history
  • Loading branch information
ccmaymay committed Oct 17, 2023
1 parent f03b86a commit a7fb843
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions test_nodejs/communication_fu_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ describe("addInternalReferences", function() {
it("Returns Communication-level maps", function() {
const comm = new concrete.communication.Communication();
comm.initFromTJSONProtocolObject(commJSONData);
expect(
comm.addInternalReferences()
).to.have.all.keys([
const refs = comm.addInternalReferences();
expect(refs).to.have.all.keys([
"entityForUUID",
"entityMentionForUUID",
"sectionForUUID",
Expand All @@ -18,5 +17,32 @@ describe("addInternalReferences", function() {
"situationMentionForUUID",
"tokenizationForUUID"
]);
comm.sectionList.forEach((section) => {
expect(refs.sectionForUUID[section.uuid.uuidString]).to.equal(section);
section.sentenceList.forEach((sentence) => {
expect(refs.sentenceForUUID[sentence.uuid.uuidString]).to.equal(sentence);
expect(refs.tokenizationForUUID[sentence.tokenization.uuid.uuidString]).to.equal(sentence.tokenization);
});
});
comm.entitySetList.forEach((entitySet) =>
entitySet.entityList.forEach((entity) =>
expect(refs.entityForUUID[entity.uuid.uuidString]).to.equal(entity)
)
);
comm.entityMentionSetList.forEach((entityMentionSet) =>
entityMentionSet.mentionList.forEach((mention) =>
expect(refs.entityMentionForUUID[mention.uuid.uuidString]).to.equal(mention)
)
);
comm.situationSetList.forEach((situationSet) =>
situationSet.situationList.forEach((situation) =>
expect(refs.situationForUUID[situation.uuid.uuidString]).to.equal(situation)
)
);
comm.situationMentionSetList.forEach((situationMentionSet) =>
situationMentionSet.mentionList.forEach((mention) =>
expect(refs.situationMentionForUUID[mention.uuid.uuidString]).to.equal(mention)
)
);
});
});

0 comments on commit a7fb843

Please sign in to comment.