Add tests to patcher

This commit is contained in:
Dolan Miu
2023-03-16 01:55:18 +00:00
parent 262f6323d0
commit 7e9884081e
11 changed files with 447 additions and 81 deletions

View File

@ -20,6 +20,32 @@ describe("relationship-manager", () => {
});
expect(output).to.deep.equal(2);
});
it("should work with an empty relationship Id", () => {
const output = getNextRelationshipIndex({
elements: [
{
type: "element",
name: "Relationships",
elements: [{ type: "element", name: "Relationship" }],
},
],
});
expect(output).to.deep.equal(1);
});
it("should work with no relationships", () => {
const output = getNextRelationshipIndex({
elements: [
{
type: "element",
name: "Relationships",
elements: [],
},
],
});
expect(output).to.deep.equal(1);
});
});
describe("appendRelationship", () => {