Compose Unstyled 2.0 is out! Check the official announcement blog ->
Function

assertHeightIsEqualTo

Asserts that the layout of this node has height equal to expectedHeight.

subspaceNodeMatcherProperties

public fun subspaceNodeMatcherProperties() {
    composeTestRule.setContent {
        Subspace {
            SpatialPanel(SubspaceModifier.width(100.dp).height(100.dp).testTag("myPanel")) {}
        }
    }
    // Check existence and exact spatial dimensions in DP using semantic matchers
    composeTestRule
        .onSubspaceNodeWithTag("myPanel")
        .assertExists()
        .assertPositionInRootIsEqualTo(0.dp, 0.dp, 0.dp)
        .assertWidthIsEqualTo(100.toDp())
        .assertHeightIsEqualTo(100.toDp())
}

Last updated: