Skip to content

Commit

Permalink
test: add way more checks after decompositions
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoenig134 committed Jul 11, 2024
1 parent 23281ad commit bae6851
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions test/relationships.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,31 @@ describe("Relationships", () => {
const decompose = await client2.relationships.decomposeRelationship(relationship.id);
expect(decompose).toBeSuccessfulVoidResult();

const attributesAfterDecomposition = await client1.attributes.getAttributes({ shareInfo: { peer: client2Address } });
const relationships = await client2.relationships.getRelationships();
expect(relationships).toBeSuccessful(ValidationSchema.Relationships);
expect(relationships.result).toHaveLength(0);

const attributesAfterDecomposition = await client2.attributes.getAttributes({ shareInfo: { peer: client2Address } });
expect(attributesAfterDecomposition).toBeSuccessful(ValidationSchema.ConnectorAttributes);
expect(attributesAfterDecomposition.result).toHaveLength(2);
expect(attributesAfterDecomposition.result).toHaveLength(0);

await client1.account.sync();

const client1Relationships = await client1.relationships.getRelationships();
expect(client1Relationships).toBeSuccessful(ValidationSchema.Relationships);
expect(client1Relationships.result).toHaveLength(1);

expect(client1Relationships.result[0].status).toBe("DeletionProposed");

await client1.relationships.decomposeRelationship(client1Relationships.result[0].id);

const client1RelationshipsAfterDecompose = await client1.relationships.getRelationships();
expect(client1RelationshipsAfterDecompose).toBeSuccessful(ValidationSchema.Relationships);
expect(client1RelationshipsAfterDecompose.result).toHaveLength(0);

const client1AttributesAfterDecomposition = await client1.attributes.getAttributes({ shareInfo: { peer: client2Address } });
expect(client1AttributesAfterDecomposition).toBeSuccessful(ValidationSchema.ConnectorAttributes);
expect(client1AttributesAfterDecomposition.result).toHaveLength(0);
});
});

Expand Down

0 comments on commit bae6851

Please sign in to comment.