From 7d612e2bb7c7a560c80ed54f156cd08bf1094793 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 10 May 2021 11:24:46 +0200 Subject: [PATCH] cleaning old results og SUT plugin --- apps/remix-ide/src/app/tabs/test-tab.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index f1ff124df5..eb6edd4efb 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -76,6 +76,7 @@ module.exports = class TestTab extends ViewPlugin { this.updateGenerateFileAction() if (!this.areTestsRunning) this.updateRunAction(file) this.updateTestFileList() + this.clearResults() this.testTabLogic.getTests((error, tests) => { if (error) return tooltip(error) this.data.allTests = tests @@ -434,21 +435,26 @@ module.exports = class TestTab extends ViewPlugin { this.uiPathList.appendChild(yo``) } + clearResults () { + yo.update(this.resultStatistics, yo``) + this.call('editor', 'clearAnnotations') + this.testsOutput.innerHTML = '' + this.testsOutput.hidden = true + this.testsExecutionStopped.hidden = true + this.testsExecutionStoppedError.hidden = true + } + runTests () { this.areTestsRunning = true this.hasBeenStopped = false this.readyTestsNumber = 0 this.runningTestsNumber = this.data.selectedTests.length - yo.update(this.resultStatistics, this.createResultLabel()) const stopBtn = document.getElementById('runTestsTabStopAction') stopBtn.removeAttribute('disabled') const runBtn = document.getElementById('runTestsTabRunAction') runBtn.setAttribute('disabled', 'disabled') - this.call('editor', 'clearAnnotations') - this.testsOutput.innerHTML = '' - this.testsOutput.hidden = true - this.testsExecutionStopped.hidden = true - this.testsExecutionStoppedError.hidden = true + this.clearResults() + yo.update(this.resultStatistics, this.createResultLabel()) const tests = this.data.selectedTests if (!tests) return this.resultStatistics.hidden = tests.length === 0