Skip to content

Commit

Permalink
tests: adding regression test for vaults clone failing to connect t…
Browse files Browse the repository at this point in the history
…o target node

This caps of the work required for #74, so we'll be resolving it here.

Fixes: #74
  • Loading branch information
tegefaulkes committed Feb 8, 2024
1 parent 63f852a commit 5a31aba
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/vaults/pullClone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,28 @@ describe('pull and clone', () => {
// Now have two separate vaults
expect(result2.size).toBe(2);
});
test('should handle failure to connect while cloning', async () => {
// Attempt to clone the vault
const result = await testUtils.pkStdio(
[
'vaults',
'clone',
'-np',
dataDir,
vaultName,
nodesUtils.encodeNodeId(
nodesUtils.generateRandomNodeIdForBucket(
polykeyAgent.keyRing.getNodeId(),
100,
),
),
],
{
env: {},
cwd: dataDir,
},
);
expect(result.exitCode).toBe(75);
expect(result.stderr).toContain('ErrorNodeManagerConnectionFailed');
});
});

0 comments on commit 5a31aba

Please sign in to comment.