com.github.mvysny.kaributesting.v10.Icon.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of karibu-testing-v10 Show documentation
Show all versions of karibu-testing-v10 Show documentation
Karibu Testing, support for browserless Vaadin testing in Kotlin
package com.github.mvysny.kaributesting.v10
import com.github.mvysny.kaributools.IconName
import com.github.mvysny.kaributools.iconName
import com.vaadin.flow.component.Component
import com.vaadin.flow.component.button.Button
import com.vaadin.flow.component.icon.Icon
/**
* Returns the icon of this component. Only works with [Button] and [Icon], returns
* null for everything else.
*/
public val Component._iconName: IconName? get() = when {
this is Button -> icon?._iconName
this is Icon -> iconName
else -> null
}