Skip to content

Commit

Permalink
updated runs from URL
Browse files Browse the repository at this point in the history
test for runs
set default value in input
  • Loading branch information
Aniket-Engg committed Dec 2, 2020
1 parent 006464f commit f3767c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion apps/remix-ide-e2e/src/tests/url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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()
},

Expand Down
6 changes: 4 additions & 2 deletions apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
}

Expand Down

0 comments on commit f3767c9

Please sign in to comment.