diff --git a/web3.js/test/token-program.test.js b/web3.js/test/token-program.test.js index 8fbaf1d772..625a6c0cf8 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(); });