cleaning old results og SUT plugin

pull/5370/head
lianahus 4 years ago committed by Liana Husikyan
parent a71f59d918
commit 3881faaff1
  1. 18
      apps/remix-ide/src/app/tabs/test-tab.js

@ -76,6 +76,7 @@ module.exports = class TestTab extends ViewPlugin {
this.updateGenerateFileAction() this.updateGenerateFileAction()
if (!this.areTestsRunning) this.updateRunAction(file) if (!this.areTestsRunning) this.updateRunAction(file)
this.updateTestFileList() this.updateTestFileList()
this.clearResults()
this.testTabLogic.getTests((error, tests) => { this.testTabLogic.getTests((error, tests) => {
if (error) return tooltip(error) if (error) return tooltip(error)
this.data.allTests = tests this.data.allTests = tests
@ -434,21 +435,26 @@ module.exports = class TestTab extends ViewPlugin {
this.uiPathList.appendChild(yo`<option>${this.inputPath.value}</option>`) this.uiPathList.appendChild(yo`<option>${this.inputPath.value}</option>`)
} }
clearResults () {
yo.update(this.resultStatistics, yo`<span></span>`)
this.call('editor', 'clearAnnotations')
this.testsOutput.innerHTML = ''
this.testsOutput.hidden = true
this.testsExecutionStopped.hidden = true
this.testsExecutionStoppedError.hidden = true
}
runTests () { runTests () {
this.areTestsRunning = true this.areTestsRunning = true
this.hasBeenStopped = false this.hasBeenStopped = false
this.readyTestsNumber = 0 this.readyTestsNumber = 0
this.runningTestsNumber = this.data.selectedTests.length this.runningTestsNumber = this.data.selectedTests.length
yo.update(this.resultStatistics, this.createResultLabel())
const stopBtn = document.getElementById('runTestsTabStopAction') const stopBtn = document.getElementById('runTestsTabStopAction')
stopBtn.removeAttribute('disabled') stopBtn.removeAttribute('disabled')
const runBtn = document.getElementById('runTestsTabRunAction') const runBtn = document.getElementById('runTestsTabRunAction')
runBtn.setAttribute('disabled', 'disabled') runBtn.setAttribute('disabled', 'disabled')
this.call('editor', 'clearAnnotations') this.clearResults()
this.testsOutput.innerHTML = '' yo.update(this.resultStatistics, this.createResultLabel())
this.testsOutput.hidden = true
this.testsExecutionStopped.hidden = true
this.testsExecutionStoppedError.hidden = true
const tests = this.data.selectedTests const tests = this.data.selectedTests
if (!tests) return if (!tests) return
this.resultStatistics.hidden = tests.length === 0 this.resultStatistics.hidden = tests.length === 0

Loading…
Cancel
Save