Skip to content

Commit

Permalink
fix(a3p): provide expected error message as a regex to openVault call
Browse files Browse the repository at this point in the history
- Address review comments from Agoric#10123
- Comment:
  - Agoric#10123 (comment)
  - Agoric#10123 (comment)
  • Loading branch information
Jorge-Lopes committed Oct 8, 2024
1 parent 135fc99 commit a30148d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions a3p-integration/proposals/z:acceptance/vaults.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@ test.serial('attempt to open vaults under the minimum amount', async t => {

const mint = '3.0';
const collateral = '5.0';
const error = await t.throwsAsync(() =>
openVault(USER1ADDR, mint, collateral),
);

t.true(
error?.message.includes(
'Error: Vault creation requires a minInitialDebt of {"brand":"[Alleged: IST brand]","value":"[5000000n]"}',
),
'Error message does not contain the expected text',
await t.throwsAsync(
() => openVault(USER1ADDR, mint, collateral),
{
message:
/Vault creation requires a minInitialDebt of {"brand":"\[Alleged: IST brand\]","value":"\[5000000n\]"}/,
},
'Error triggered by openVault does not contain the expected message',
);

const activeVaultsAfter = await agopsVaults(USER1ADDR);
t.log('active vaults after:', activeVaultsAfter);

t.true(
activeVaultsAfter.length === activeVaultsBefore.length,
t.is(
activeVaultsAfter.length,
activeVaultsBefore.length,
'The number of active vaults should remain the same.',
);
});
Expand Down

0 comments on commit a30148d

Please sign in to comment.