From 16bd2bd1f591b9cd9b47cc0cac3ce321e51574b2 Mon Sep 17 00:00:00 2001 From: Arkadii Sapozhnikov Date: Wed, 17 Jan 2024 16:45:51 +0100 Subject: [PATCH] fix number of passed tests updating --- .../research/testspark/display/TestCasePanelFactory.kt | 7 +++++++ .../research/testspark/display/TopButtonsPanelFactory.kt | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/jetbrains/research/testspark/display/TestCasePanelFactory.kt b/src/main/kotlin/org/jetbrains/research/testspark/display/TestCasePanelFactory.kt index 5018a697a..c420bdeba 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/display/TestCasePanelFactory.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/display/TestCasePanelFactory.kt @@ -604,6 +604,13 @@ class TestCasePanelFactory( updateUI() } + /** + * Checks if the item is marked as removed. + * + * @return true if the item is removed, false otherwise. + */ + fun isRemoved() = isRemoved + /** * Returns the indexes of lines that are modified between two lists of strings. * diff --git a/src/main/kotlin/org/jetbrains/research/testspark/display/TopButtonsPanelFactory.kt b/src/main/kotlin/org/jetbrains/research/testspark/display/TopButtonsPanelFactory.kt index 646f02df1..93f568304 100644 --- a/src/main/kotlin/org/jetbrains/research/testspark/display/TopButtonsPanelFactory.kt +++ b/src/main/kotlin/org/jetbrains/research/testspark/display/TopButtonsPanelFactory.kt @@ -59,7 +59,9 @@ class TopButtonsPanelFactory(private val project: Project) { fun updateTopLabels() { var numberOfPassedTests = 0 for (testCasePanelFactory in testCasePanelFactories) { - if (testCasePanelFactory.getError() == "") { + if (testCasePanelFactory.isRemoved()) continue + val error = testCasePanelFactory.getError() + if ((error is String) && error.isEmpty()) { numberOfPassedTests++ } }