---
title: "assertContentDescriptionEquals"
description: "Asserts that the node's list of content descriptions contains exactly the given values and nothing else."
type: "function"
lastmod: "2026-06-18T10:32:52.741374Z"
---
## API Reference

### assertContentDescriptionEquals

> Source set: Common

```kotlin
fun SemanticsNodeInteraction.assertContentDescriptionEquals(
    vararg values: String
): SemanticsNodeInteraction
```

Asserts that the node's list of content descriptions contains exactly the given `values` and
nothing else.

The `ContentDescription` property is represented as a list of strings. In the merged semantics
tree (the default in Compose testing), this list often contains multiple descriptions merged from
child nodes. This function evaluates the entire list.

The assertion will only pass if the node's list contains all the provided `values`, and contains
no additional items. Note that the order of the elements does not matter.

Typically, accessibility tooling will decide based on its heuristics which descriptions to
announce.

Throws `AssertionError` if the node's descriptions don't contain all items from `values`, or if
the descriptions contain extra items that are not in `values`.

#### Parameters

| | |
| --- | --- |
| values | List of values to match (the order does not matter). |

## Code Examples
### assertContentDescriptionEqualsSample
```kotlin
fun assertContentDescriptionEqualsSample() {
    composeTestRule.setContent {
        // Explicitly merging descendants to demonstrate list semantics
        Row(Modifier.semantics(mergeDescendants = true) { testTag = "iconRow" }) {
            Icon(ColorPainter(Color.Red), contentDescription = "Navigate Up")
            Icon(ColorPainter(Color.Yellow), contentDescription = "Go Home")
        }
    }
    // The merged content description list is: ["Navigate Up", "Go Home"]
    // We provide all items exactly as they appear in the merged list.
    // Order does not matter.
    composeTestRule
        .onNodeWithTag("iconRow")
        .assertContentDescriptionEquals("Go Home", "Navigate Up")
}
```
