From a7e597bad0e60aa23b7be0a89e7ada549ad30759 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 9 Jan 2020 10:19:16 +0100 Subject: [PATCH 1/3] Export to Gist if "id" is not defined, it is not a gist update but a creation. we have to take the file from the browser explorer --- src/app/files/file-explorer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 899da13702..8eb9703692 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -470,7 +470,8 @@ fileExplorer.prototype.toGist = function (id) { return data.files || [] } - this.packageFiles(this.files, 'browser/gists/' + id, (error, packaged) => { + const folder = id ? 'browser/gists/' + id : 'browser/' + this.packageFiles(this.files, folder, (error, packaged) => { if (error) { console.log(error) modalDialogCustom.alert('Failed to create gist: ' + error) From a80bb0420888aa0ce4eeb5151cc56e0e465a6a38 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 10 Jan 2020 12:12:17 +0100 Subject: [PATCH 2/3] add browser tests --- package.json | 1 + src/app/files/file-explorer.js | 4 +- test-browser/commands/executeScript.js | 1 + test-browser/commands/getModalBody.js | 16 +++++++ .../commands/modalFooterCancelClick.js | 17 +++++++ test-browser/commands/modalFooterOKClick.js | 2 +- test-browser/commands/switchFile.js | 1 + test-browser/tests/gist.js | 45 +++++++++++++++++++ 8 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 test-browser/commands/getModalBody.js create mode 100644 test-browser/commands/modalFooterCancelClick.js create mode 100644 test-browser/tests/gist.js diff --git a/package.json b/package.json index ec518ecf41..ea5e12e8d9 100644 --- a/package.json +++ b/package.json @@ -170,6 +170,7 @@ "nightwatch_local_solidityUnittests": "nightwatch ./test-browser/tests/solidityUnittests.js --config nightwatch.js --env chrome ", "nightwatch_local_remixd": "nightwatch ./test-browser/tests/remix.js --config nightwatch.js --env chrome ", "nightwatch_local_console": "nightwatch ./test-browser/tests/console.js --config nightwatch.js --env chrome ", + "nightwatch_local_gist": "nightwatch ./test-browser/tests/gist.js --config nightwatch.js --env chrome ", "onchange": "onchange build/app.js -- npm-run-all lint", "prepublish": "mkdirp build; npm-run-all -ls downloadsolc_root build", "remixd": "remixd -s ./contracts --remix-ide http://127.0.0.1:8080", diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 8eb9703692..340cd90e01 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -633,7 +633,7 @@ fileExplorer.prototype.renderMenuItems = function () { items = this.menuItems.map(({action, title, icon}) => { if (action === 'uploadFile') { return yo` -