Skip to content

Commit

Permalink
feat: close vault action
Browse files Browse the repository at this point in the history
update tests
  • Loading branch information
Valentine Panchin committed Dec 1, 2021
1 parent 7b616c3 commit 8f84d48
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
11 changes: 8 additions & 3 deletions test/actions/closeVault.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ describe('closing a Vault', () => {
});

test('closes vault', async () => {

let vault;
const vaultResponse = await createVault({
connection,
wallet,
Expand All @@ -28,7 +30,9 @@ describe('closing a Vault', () => {
});

await pause(20000);
expect(await Vault.load(connection, vaultResponse.vault)).toHaveProperty('data');
vault = await Vault.load(connection, vaultResponse.vault);
expect(vault).toHaveProperty('data');
expect(vault.data.state).toEqual(0);

closeVault({
connection,
Expand All @@ -40,8 +44,9 @@ describe('closing a Vault', () => {

await pause(20000);

console.log('OK');
expect(await Vault.load(connection, vaultResponse.vault)).toHaveProperty('data');
vault = await Vault.load(connection, vaultResponse.vault);
expect(vault).toHaveProperty('data');
expect(vault.data.state).toEqual(2);
});
});
});
5 changes: 3 additions & 2 deletions test/actions/createVault.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ describe('creating a Vault', () => {
});

await pause(20000);

expect(await Vault.load(connection, vaultResponse.vault)).toHaveProperty('data');
const vault = await Vault.load(connection, vaultResponse.vault);
expect(vault).toHaveProperty('data');
expect(vault.data.state).toEqual(0);
});
});
});
Loading

0 comments on commit 8f84d48

Please sign in to comment.