From f3767c9299cc86abcc302e0cafe6fc30dcd332cc Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 25 Nov 2020 18:05:24 +0530 Subject: [PATCH] updated runs from URL test for runs set default value in input --- apps/remix-ide-e2e/src/tests/url.test.ts | 4 +++- apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index d89b381e21..07f39ff8a9 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -23,6 +23,7 @@ module.exports = { .assert.containsText('#versionSelector option[selected="selected"]', '0.7.4+commit.3f05b770') .assert.containsText('#evmVersionSelector option[selected="selected"]', 'istanbul') .verify.elementPresent('#optimize:checked') + .verify.attributeEquals('#runs', 'value', '300') }, 'Should load using compiler from link passed in remix URL': function (browser: NightwatchBrowser) { @@ -34,9 +35,10 @@ module.exports = { .pause(5000) .assert.containsText('#versionSelector option[selected="selected"]', 'custom') // default values + .assert.containsText('#evmVersionSelector option[selected="selected"]', 'default') .verify.elementPresent('#optimize') .assert.elementNotPresent('#optimize:checked') - .assert.containsText('#evmVersionSelector option[selected="selected"]', 'default') + .verify.elementPresent('#runs:disabled') .end() }, diff --git a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js index ca8583f506..1bc28e1191 100644 --- a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js +++ b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js @@ -197,12 +197,14 @@ class CompilerContainer { class="custom-select ml-2 ${css.runs}" id="runs" placeholder="200" + value="200" type="number" title="Estimated number of times each opcode of the deployed code will be executed across the life-time of the contract." onchange=${() => this.onchangeRuns()} >` - if (this.compileTabLogic.optimize) this._view.runs.removeAttribute('disabled') - else { + if (this.compileTabLogic.optimize) { + this._view.runs.value = this.compileTabLogic.runs + } else { this._view.runs.setAttribute('disabled', '') }