Skip to content

Commit

Permalink
test: add unit tests for isConnected method
Browse files Browse the repository at this point in the history
  • Loading branch information
DIY0R committed Sep 6, 2024
1 parent 6cf1e93 commit ac0ae22
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/graph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,17 @@ describe('Links operations', () => {
);
}
});

test('check if two vertices are connected', async () => {
const createVertices = await graph.createVertices([
{ name: 'V-0' },
{ name: 'V-0-1' },
{ name: 'V-1' },
]);
const ids = createVertices.map(result => result.id) as IUuidArray;
await graph.createArcs(ids);

const result = await graph.isConnected(ids[0], ids.at(-1));
assert.equal(result, true);
});
});

0 comments on commit ac0ae22

Please sign in to comment.