From ca5c16dbae42177085403b7fa90832d166d61f13 Mon Sep 17 00:00:00 2001 From: 5pecia1 Date: Mon, 14 Dec 2020 08:45:11 +0900 Subject: [PATCH] add test code about SetOption in toeknERC20.test Signed-off-by: 5pecia1 --- .../chaincode-javascript/test/tokenERC20.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/token-erc-20/chaincode-javascript/test/tokenERC20.test.js b/token-erc-20/chaincode-javascript/test/tokenERC20.test.js index 6cfafa58..0f02b774 100644 --- a/token-erc-20/chaincode-javascript/test/tokenERC20.test.js +++ b/token-erc-20/chaincode-javascript/test/tokenERC20.test.js @@ -190,6 +190,16 @@ describe('Chaincode', () => { }); }); + describe('#SetOption', () => { + it('should work', async () => { + const response = await token.SetOption(ctx, 'some name', 'some symbol', '2'); + sinon.assert.calledWith(mockStub.putState, 'name', Buffer.from('some name')); + sinon.assert.calledWith(mockStub.putState, 'symbol', Buffer.from('some symbol')); + sinon.assert.calledWith(mockStub.putState, 'decimals', Buffer.from('2')); + expect(response).to.equals(true); + }); + }); + describe('#Mint', () => { it('should add token to a new account and a new total supply', async () => { mockClientIdentity.getMSPID.returns('Org1MSP');