Skip to content

Commit

Permalink
dict test added
Browse files Browse the repository at this point in the history
  • Loading branch information
volovyks committed Jun 2, 2022
1 parent 7771f44 commit b67676a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/__tests__/function-params.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ test.afterEach(async t => {
});


// test('Developer can pass parameters as dictionary', async t => {
// const { ali, jsvm, testContract } = t.context.accounts;
test('Developer can pass parameters as dictionary', async t => {
const { ali, jsvm, testContract } = t.context.accounts;

// await ali.call(jsvm, 'call_js_contract', encodeCall(testContract.accountId, 'set_values', ['newVal1', 'newVal2', 'newVal3']), { attachedDeposit: '100000000000000000000000' });
await ali.call(jsvm, 'call_js_contract', encodeCall(testContract.accountId, 'set_values', { param1: 'newVal1', param2: 'newVal2', param3: 'newVal3' }), { attachedDeposit: '100000000000000000000000' });

// t.is(
// await jsvm.view('view_js_contract', encodeCall(testContract.accountId, 'get_values', [])),
// { val3: this.newVal1, val2: this.newVal2, val1: this.newVal3 }
// );
// });
t.deepEqual(
await jsvm.view('view_js_contract', encodeCall(testContract.accountId, 'get_values', {})),
{ val3: 'newVal3', val2: 'newVal2', val1: 'newVal1' }
);
});

test('Developer can pass parameters as array', async t => {
const { ali, jsvm, testContract } = t.context.accounts;
Expand Down

0 comments on commit b67676a

Please sign in to comment.