[rdct-tests] handleCheckBoxWithFileName: minor polishes

GitOrigin-RevId: 448431b71c7586360bbd1e0a4aefc18aed4ac441
This commit is contained in:
Anastasia Katsman
2024-12-04 19:17:55 +01:00
committed by intellij-monorepo-bot
parent 9c88d9696a
commit 53caa81e0e

View File

@@ -23,16 +23,16 @@ class JChangesListViewFixture(private val robot: Robot, private val component: J
private fun handleCheckBoxWithFileName(fileName: String, setEnabled: Boolean) {
val root = component.model.root as DefaultMutableTreeNode
val node = TreeUtil.findNode(root) { it.toString().contains(fileName) }
val node = TreeUtil.findNode(root) { it.toString().contains(fileName) } ?: error("Node with name containing $fileName is not found")
val fileTreePath = TreePath(node!!.path)
val fileTreePath = TreePath(node.path)
val checkbox = getCheckBoxForNode(node, fileTreePath)
if (checkbox.isSelected != setEnabled) {
val fileTrePathLocation = computeOnEdt {
val fileTreePathLocation = computeOnEdt {
component.getPathBounds(fileTreePath) ?: error("Have not found bounds")
}
clickOnCheckbox(checkbox, fileTrePathLocation)
clickOnCheckbox(checkbox, fileTreePathLocation)
}
}