diff --git a/src/app/ui/copy-to-clipboard.js b/src/app/ui/copy-to-clipboard.js index 435f956489..1ad72032ce 100644 --- a/src/app/ui/copy-to-clipboard.js +++ b/src/app/ui/copy-to-clipboard.js @@ -24,6 +24,11 @@ module.exports = function copyToClipboard (getContent) { event.stopPropagation() var copiableContent = getContent() if (copiableContent) { // module `copy` keeps last copied thing in the memory, so don't show tooltip if nothing is copied, because nothing was added to memory + try { + if (typeof copiableContent !== 'string') { + copiableContent = JSON.stringify(copiableContent, null, '\t') + } + } catch (e) {} copy(copiableContent) addTooltip(event) } diff --git a/test-browser/tests/compiling.js b/test-browser/tests/compiling.js index b67ab929e4..f8a4aa167b 100644 --- a/test-browser/tests/compiling.js +++ b/test-browser/tests/compiling.js @@ -35,6 +35,8 @@ function testSimpleContract (browser, callback) { browser.click('.runView') .click('#runTabView div[class^="create"]') .pause(500) + .click('#runTabView .instance div[class^="title"]') + .click('#runTabView .instance div[class^="title"]') .testFunction('f - transact (not payable)', '0xa178c603400a184ce5fedbcfab392d9b77822f6ffa7facdec693aded214523bc', '[vm] from:0xca3...a733c, to:TestContract.f() 0x692...77b3a, value:0 wei, data:0x261...21ff0, 0 logs, hash:0xa17...523bc', null,