Skip to content

Commit

Permalink
Fix bug with testFramework list presentation #2374 (#2381)
Browse files Browse the repository at this point in the history
* Fix bug with testFramework list presentation

* Rename method
  • Loading branch information
tepa46 authored Jul 7, 2023
1 parent 662763b commit f0662a7
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
springTestType.item =
if (isSpringConfigSelected()) settings.springTestType else SpringTestType.defaultItem
updateSpringSettings()
updateTestFrameworkList(settings.springTestType)
updateTestFrameworksList(springTestType.item)
}
ProjectType.Python,
ProjectType.JavaScript -> { }
Expand Down Expand Up @@ -1167,7 +1167,7 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
val comboBox = event.source as ComboBox<*>
val item = comboBox.item as SpringTestType

updateTestFrameworkList(item)
updateTestFrameworksList(item)

when (item) {
UNIT_TEST -> {
Expand Down Expand Up @@ -1205,20 +1205,20 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
}
enabledTestFrameworks.forEach { if (it.isInstalled && !defaultItem.isInstalled) defaultItem = it }

updateTestFrameworkList(enabledTestFrameworks, defaultItem)
updateTestFrameworksList(enabledTestFrameworks, defaultItem)
}

private fun updateTestFrameworkList(springTestType: SpringTestType) {
private fun updateTestFrameworksList(springTestType: SpringTestType) {
// We do not support Spring integration tests for TestNg
val enabledTestFrameworks = when (springTestType) {
UNIT_TEST -> TestFramework.allItems
INTEGRATION_TEST -> TestFramework.allItems.filterNot { it == TestNg }
}

updateTestFrameworkList(enabledTestFrameworks)
updateTestFrameworksList(enabledTestFrameworks)
}

private fun updateTestFrameworkList(
private fun updateTestFrameworksList(
enabledTestFrameworks: List<TestFramework>,
defaultItem: TestFramework = TestFramework.defaultItem,
) {
Expand Down

0 comments on commit f0662a7

Please sign in to comment.