From d40712999c3ba0ba4a45c2cb7a9d54d2e7c057d3 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 10 Oct 2018 10:42:00 -0700 Subject: [PATCH] test: add delegate mismatch test case --- web3.js/test/token-program.test.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web3.js/test/token-program.test.js b/web3.js/test/token-program.test.js index 8fbaf1d77..625a6c0cf 100644 --- a/web3.js/test/token-program.test.js +++ b/web3.js/test/token-program.test.js @@ -448,9 +448,10 @@ test('invalid approve', async () => { const owner = await newAccountWithTokens(connection); const account1 = await testToken.newAccount(owner); + const account1Delegate = await testToken.newAccount(owner, account1); const account2 = await testToken.newAccount(owner); - // account2 is not a delegate account + // account2 is not a delegate account of account1 expect( testToken.approve( owner, @@ -459,6 +460,16 @@ test('invalid approve', async () => { 123 ) ).rejects.toThrow(); + + // account1Delegate is not a delegate account of account2 + expect( + testToken.approve( + owner, + account2, + account1Delegate, + 123 + ) + ).rejects.toThrow(); });