---
title: "assertHeightIsEqualTo"
description: "Asserts that the layout of this node has height equal to expectedHeight."
type: "function"
lastmod: "2026-06-18T10:32:52.425279Z"
---
## API Reference

### assertHeightIsEqualTo

> Source set: Android

```kotlin
@CanIgnoreReturnValue
public fun SubspaceSemanticsNodeInteraction.assertHeightIsEqualTo(
    expectedHeight: Dp
): SubspaceSemanticsNodeInteraction
```

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

#### Parameters

| | |
| --- | --- |
| expectedHeight | The height to assert. |

## Code Examples
### subspaceNodeMatcherProperties
```kotlin
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())
}
```
