add test code about SetOption in toeknERC20.test

Signed-off-by: 5pecia1 <pdpxpd@gmail.com>
This commit is contained in:
5pecia1 2020-12-14 08:45:11 +09:00 committed by denyeart
parent 9b8f50e2d0
commit ca5c16dbae

View file

@ -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');