Merge pull request #2715 from ethereum/run-test-button

Disabled 'Run Tests' Button When No Test Is Selected.
pull/5370/head
yann300 5 years ago committed by GitHub
commit bf9f0e1966
  1. 6
      src/app/tabs/test-tab.js

@ -83,10 +83,16 @@ module.exports = class TestTab extends ViewPlugin {
selectedTests = eChecked ? [...selectedTests, test] : selectedTests.filter(el => el !== test) selectedTests = eChecked ? [...selectedTests, test] : selectedTests.filter(el => el !== test)
this.data.selectedTests = selectedTests this.data.selectedTests = selectedTests
let checkAll = this._view.el.querySelector('[id="checkAllTests"]') let checkAll = this._view.el.querySelector('[id="checkAllTests"]')
const runBtn = document.getElementById('runTestsTabRunAction')
if (eChecked) { if (eChecked) {
checkAll.checked = true checkAll.checked = true
runBtn.removeAttribute('disabled')
runBtn.setAttribute('title', 'Run tests')
} else if (!selectedTests.length) { } else if (!selectedTests.length) {
checkAll.checked = false checkAll.checked = false
runBtn.setAttribute('disabled', 'disabled')
runBtn.setAttribute('title', 'No test file selected')
} }
} }

Loading…
Cancel
Save