Skip to content

Commit

Permalink
BE-688 Fix a bug on chaincode view
Browse files Browse the repository at this point in the history
Missed adding channelName when populating data from SQL resp

Signed-off-by: Atsushi Neki <atsushin@fast.au.fujitsu.com>
Change-Id: I4805b31fc4eda6f96aca88bad5f3f802e07be717
  • Loading branch information
nekia committed Aug 15, 2019
1 parent 2c6eed5 commit 2518b61
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/persistence/fabric/MetricService.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class MetricService {
c.forEach((item, index) => {
txArray.push({
chaincodename: item.chaincodename,
channelName: item.channelname,
path: item.path,
version: item.version,
txCount: item.c,
Expand Down
49 changes: 49 additions & 0 deletions client/test/specs/chaincode_view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* SPDX-License-Identifier: Apache-2.0
*/

/* eslint-disable no-unused-expressions */

require('chai').should();

describe('Explorer chaincode view', () => {
before(function() {
// runs before all tests in this block
browser.url('http://explorer.mynetwork.com:8080');
// Login
var userInput = browser.$('#user');
var passInput = browser.$('#password');
userInput.setValue('test');
passInput.setValue('test');
var signinBtn = browser.$('#root > div > div > div > form > button > span');

signinBtn.click();
browser.pause(1000);
});

describe('chaincode list', () => {
it('should have an entry: BE-688', () => {
// Num. of blocks
var ccLink = browser.$(
'#root > div > div:nth-child(1) > div:nth-child(2) > nav > div > ul > li:nth-child(5)'
);
ccLink.click();
browser.pause(5000);

var ccName = browser.$(
'#root > div > div > div > div > div > div > div > div.rt-table > div.rt-tbody > div > div > div:nth-child(1)'
);
ccName.getText().should.be.equal('mycc');

var ccTxCount = browser.$(
'#root > div > div > div > div > div > div > div > div.rt-table > div.rt-tbody > div > div > div:nth-child(4)'
);
ccTxCount.getText().should.be.equal('5');

var ccChName = browser.$(
'#root > div > div > div > div > div > div > div > div.rt-table > div.rt-tbody > div > div > div:nth-child(2)'
);
ccChName.getText().should.be.equal('mychannel');
});
});
});
1 change: 0 additions & 1 deletion client/test/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ exports.config = {
// to run chrome headless the following flags are required
// (see https://developers.google.com/web/updates/2017/04/headless-chrome)
args: [
'--headless',
'--disable-gpu',
'--whitelisted-ips',
'--no-sandbox',
Expand Down

0 comments on commit 2518b61

Please sign in to comment.