# androidx.glance.appwidget.testing.unit

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest` | Provides methods to enable you to test your logic of building Glance composable content in the `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#runGlanceAppWidgetUnitTest(kotlin.time.Duration,kotlin.Function1)` scope. |

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTestDefaults` | Provides default values for various properties used in the Glance appWidget unit tests. |

## Top-level functions summary

|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `<T : https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasRunCallbackClickAction(androidx.glance.action.ActionParameters)( parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters )` Returns a matcher that matches if a node has a clickable set with action that runs a callback. |
| `inline https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `<T : https://developer.android.com/reference/android/content/BroadcastReceiver.html> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasSendBroadcastAction()()` Returns a matcher that matches if a node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasSendBroadcastAction(android.content.ComponentName)(componentName: https://developer.android.com/reference/android/content/ComponentName.html)` Returns a matcher that matches if a node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasSendBroadcastAction(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Returns a matcher that matches if a node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasSendBroadcastAction(kotlin.String,android.content.ComponentName)( intentAction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, componentName: https://developer.android.com/reference/android/content/ComponentName.html? )` Returns a matcher that matches if a node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasStartActivityClickAction(android.content.Intent,androidx.glance.action.ActionParameters,android.os.Bundle)( intent: https://developer.android.com/reference/android/content/Intent.html, parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters, activityOptions: https://developer.android.com/reference/android/os/Bundle.html? )` Returns a matcher that matches if a node has a clickable set with action that starts an activity. |
| `inline https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `<T : https://developer.android.com/reference/android/app/Service.html> https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasStartServiceAction(kotlin.Boolean)(isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns a matcher that matches if a node has a clickable set with action that starts a service. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#hasStartServiceAction(android.content.Intent,kotlin.Boolean)(intent: https://developer.android.com/reference/android/content/Intent.html, isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns a matcher that matches if a node has a clickable set with action that starts a service. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#isChecked()()` Returns a matcher that matches if a node is checkable (e.g. radio button, switch, checkbox) and is checked. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#isIndeterminateCircularProgressIndicator()()` Returns a matcher that matches if a given node is an indeterminate circular progress indicator. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#isIndeterminateLinearProgressIndicator()()` Returns a matcher that matches if a given node is an indeterminate progress bar. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#isLinearProgressIndicator(kotlin.Float)(progress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Returns a matcher that matches if a given node is a linear progress indicator with given progress value. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeMatcher<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#isNotChecked()()` Returns a matcher that matches if a node is checkable (e.g. radio button, switch, checkbox) but is not checked. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#runGlanceAppWidgetUnitTest(kotlin.time.Duration,kotlin.Function1)(timeout: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-duration/index.html, block: https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Sets up the test environment and runs the given unit `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#runGlanceAppWidgetUnitTest(kotlin.time.Duration,kotlin.Function1)`. |

## Extension functions summary

|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `<T : https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback> https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasRunCallbackClickAction(androidx.glance.action.ActionParameters)( parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters )` Asserts that a given node has a clickable set with action that runs a callback. |
| `inline https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `<T : https://developer.android.com/reference/android/content/BroadcastReceiver.html> https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasSendBroadcastClickAction()( )` Asserts that a given node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasSendBroadcastClickAction(android.content.ComponentName)( componentName: https://developer.android.com/reference/android/content/ComponentName.html )` Asserts that a given node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasSendBroadcastClickAction(android.content.Intent)( intent: https://developer.android.com/reference/android/content/Intent.html )` Asserts that a given node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasSendBroadcastClickAction(kotlin.String,android.content.ComponentName)( intentAction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, componentName: https://developer.android.com/reference/android/content/ComponentName.html? )` Asserts that a given node has a clickable set with action that sends a broadcast. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasStartActivityClickAction(android.content.Intent,androidx.glance.action.ActionParameters,android.os.Bundle)( intent: https://developer.android.com/reference/android/content/Intent.html, parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters, activityOptions: https://developer.android.com/reference/android/os/Bundle.html? )` Asserts that a given node has a clickable set with action that starts an activity. |
| `inline https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `<T : https://developer.android.com/reference/android/app/Service.html> https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasStartServiceClickAction(kotlin.Boolean)( isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Asserts that a given node has a clickable set with action that starts a service. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasStartServiceClickAction(android.content.ComponentName,kotlin.Boolean)( componentName: https://developer.android.com/reference/android/content/ComponentName.html, isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Asserts that a given node has a clickable set with action that starts a service. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertHasStartServiceClickAction(android.content.Intent,kotlin.Boolean)( intent: https://developer.android.com/reference/android/content/Intent.html, isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Asserts that a given node has a clickable set with action that starts a service. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertIsChecked()()` Asserts that a given node is checkable and is checked. |
| `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>` | `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertion<https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/MappedNode, https://developer.android.com/reference/kotlin/androidx/glance/testing/unit/GlanceMappedNode>.https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#(androidx.glance.testing.GlanceNodeAssertion).assertIsNotChecked()()` Asserts that a given node is checkable and is not checked. |

## Top-level functions

### hasRunCallbackClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasRunCallbackClickAction)

```
inline fun <T : ActionCallback> hasRunCallbackClickAction(
    parameters: ActionParameters = actionParametersOf()
): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that runs a callback.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback>` | callback class that is expected to have been passed in the `actionRunCallback` method call |
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action that are expected to have been passed in the `actionRunCallback` method call |

### hasSendBroadcastAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasSendBroadcastAction)

```
inline fun <T : BroadcastReceiver> hasSendBroadcastAction(): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that sends a broadcast.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/android/content/BroadcastReceiver.html>` | class of the broadcast receiver that is expected to have been passed in the actionSendBroadcast\` method call. |

### hasSendBroadcastAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasSendBroadcastAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun hasSendBroadcastAction(componentName: ComponentName): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that sends a broadcast.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/android/content/ComponentName.html` of the target broadcast receiver that is expected to have been passed in the actionSendBroadcast\` method call. |

### hasSendBroadcastAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasSendBroadcastAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun hasSendBroadcastAction(intent: Intent): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that sends a broadcast.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent for sending broadcast that is expected to have been passed in the `actionSendBroadcast` method call. Note: intent is only matched using filterEquals. |

### hasSendBroadcastAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasSendBroadcastAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun hasSendBroadcastAction(
    intentAction: String,
    componentName: ComponentName? = null
): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that sends a broadcast.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `intentAction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the intent action of the broadcast receiver that is expected to have been passed in the `actionSendBroadcast` method call. |
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html? = null` | optional `https://developer.android.com/reference/android/content/ComponentName.html` of the target broadcast receiver that is expected to have been passed in the actionSendBroadcast\` method call. |

### hasStartActivityClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasStartActivityClickAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun hasStartActivityClickAction(
    intent: Intent,
    parameters: ActionParameters = actionParametersOf(),
    activityOptions: Bundle? = null
): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that starts an activity.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent for launching an activity that is expected to have been passed in the `actionStartActivity` method call. Note: Only matches if intents are same per `filterEquals`. |
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action that are expected to have been passed in the `actionStartActivity` method call |
| `activityOptions: https://developer.android.com/reference/android/os/Bundle.html? = null` | Additional options built from an `https://developer.android.com/reference/android/app/ActivityOptions.html` to apply to an activity start. |

### hasStartServiceAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasStartServiceAction)

```
inline fun <T : Service> hasStartServiceAction(isForegroundService: Boolean = false): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that starts a service.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/android/app/Service.html>` | class of the service to launch that is expected to have been passed in the `actionStartService` method call. |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if the service to launch is expected to have been set as foreground service in the `actionStartService` method call. |

### hasStartServiceAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:hasStartServiceAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun hasStartServiceAction(intent: Intent, isForegroundService: Boolean = false): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node has a clickable set with action that starts a service.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent for launching the service that is expected to have been passed in the `actionStartService` method call. |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if the service to launch is expected to have been set as foreground service in the `actionStartService` method call. |

### isChecked

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:isChecked) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun isChecked(): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node is checkable (e.g. radio button, switch, checkbox) and is checked.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

### isIndeterminateCircularProgressIndicator

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:isIndeterminateCircularProgressIndicator) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun isIndeterminateCircularProgressIndicator(): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a given node is an indeterminate circular progress indicator.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

### isIndeterminateLinearProgressIndicator

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:isIndeterminateLinearProgressIndicator) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun isIndeterminateLinearProgressIndicator(): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a given node is an indeterminate progress bar.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

### isLinearProgressIndicator

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:isLinearProgressIndicator) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun isLinearProgressIndicator(progress: Float): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a given node is a linear progress indicator with given progress value.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

| Parameters |
|---|---|
| `progress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the expected value of the current progress |

### isNotChecked

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestFilters.kt+function:isNotChecked) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun isNotChecked(): GlanceNodeMatcher<MappedNode>
```

Returns a matcher that matches if a node is checkable (e.g. radio button, switch, checkbox) but is not checked.

This can be passed in `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onNode(androidx.glance.testing.GlanceNodeMatcher)` and `https://developer.android.com/reference/kotlin/androidx/glance/testing/GlanceNodeAssertionsProvider#onAllNodes(androidx.glance.testing.GlanceNodeMatcher)` functions on assertion providers to filter out matching node(s) or in assertions to validate that node(s) satisfy the condition.

### runGlanceAppWidgetUnitTest

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest.kt+function:runGlanceAppWidgetUnitTest)

```
fun runGlanceAppWidgetUnitTest(
    timeout: Duration = DEFAULT_TIMEOUT,
    block: GlanceAppWidgetUnitTest.() -> Unit
): Unit
```

Sets up the test environment and runs the given unit `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/package-summary#runGlanceAppWidgetUnitTest(kotlin.time.Duration,kotlin.Function1)`. Use the methods on `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest` in the test to provide Glance composable content, find Glance elements and make assertions on them.

Test your individual Glance composable functions in isolation to verify that your logic outputs right elements. For example: if input data is 'x', an image 'y' was outputted. In sample below, the test class has a separate test for the header and the status row.

Tests can be run on JVM as these don't involve rendering the UI. If your logic depends on `https://developer.android.com/reference/android/content/Context.html` or other android APIs, tests can be run on Android unit testing frameworks such as [Robolectric](https://github.com/robolectric/robolectric).

Note: Keeping a reference to the `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest` outside of this function is an error.

```kotlin
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.glance.GlanceModifier
import androidx.glance.LocalSize
import androidx.glance.appwidget.testing.unit.runGlanceAppWidgetUnitTest
import androidx.glance.layout.Column
import androidx.glance.layout.Row
import androidx.glance.layout.Spacer
import androidx.glance.layout.fillMaxSize
import androidx.glance.layout.width
import androidx.glance.semantics.semantics
import androidx.glance.semantics.testTag
import androidx.glance.testing.unit.hasTestTag
import androidx.glance.testing.unit.hasText
import androidx.glance.text.Text

class TestSample {
    @Test
    fun statusContent_statusFalse_outputsPending() = runGlanceAppWidgetUnitTest {
        provideComposable { StatusRow(status = false) }

        onNode(hasTestTag("status-text")).assert(hasText("Pending"))
    }

    @Test
    fun statusContent_statusTrue_outputsFinished() = runGlanceAppWidgetUnitTest {
        provideComposable { StatusRow(status = true) }

        onNode(hasTestTag("status-text")).assert(hasText("Finished"))
    }

    @Test
    fun header_smallSize_showsShortHeaderText() = runGlanceAppWidgetUnitTest {
        setAppWidgetSize(DpSize(width = 50.dp, height = 100.dp))

        provideComposable { StatusRow(status = false) }

        onNode(hasTestTag("header-text")).assert(hasText("MyApp"))
    }

    @Test
    fun header_largeSize_showsLongHeaderText() = runGlanceAppWidgetUnitTest {
        setAppWidgetSize(DpSize(width = 150.dp, height = 100.dp))

        provideComposable { StatusRow(status = false) }

        onNode(hasTestTag("header-text")).assert(hasText("MyApp (Last order)"))
    }

    @Composable
    fun WidgetContent(status: Boolean) {
        Column {
            Header()
            Spacer()
            StatusRow(status)
        }
    }

    @Composable
    fun Header() {
        val width = LocalSize.current.width
        Row(modifier = GlanceModifier.fillMaxSize()) {
            Text(
                text =
                    if (width > 50.dp) {
                        "MyApp (Last order)"
                    } else {
                        "MyApp"
                    },
                modifier = GlanceModifier.semantics { testTag = "header-text" },
            )
        }
    }

    @Composable
    fun StatusRow(status: Boolean) {
        Row(modifier = GlanceModifier.fillMaxSize()) {
            Text(text = "Status")
            Spacer(modifier = GlanceModifier.width(10.dp))
            Text(
                text =
                    if (status) {
                        "Pending"
                    } else {
                        "Finished"
                    },
                modifier = GlanceModifier.semantics { testTag = "status-text" },
            )
        }
    }
}
```

| Parameters |
|---|---|
| `timeout: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.time/-duration/index.html = DEFAULT_TIMEOUT` | test time out; defaults to 10s |
| `block: https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The test block that involves calling methods in `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest` |

## Extension functions

### GlanceNodeAssertion.assertHasRunCallbackClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasRunCallbackClickAction)

```
inline fun <T : ActionCallback> GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasRunCallbackClickAction(
    parameters: ActionParameters = actionParametersOf()
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that runs a callback.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/kotlin/androidx/glance/appwidget/action/ActionCallback>` | action callback that is expected to have been passed in the `actionRunCallback` method call |
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action that are expected to have been passed in the `actionRunCallback` method call |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasSendBroadcastClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasSendBroadcastClickAction)

```
inline fun <T : BroadcastReceiver> GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasSendBroadcastClickAction(

): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that sends a broadcast.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/android/content/BroadcastReceiver.html>` | class of the broadcast receiver that is expected to have been passed in the `actionSendBroadcast` method call. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasSendBroadcastClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasSendBroadcastClickAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasSendBroadcastClickAction(
    componentName: ComponentName
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that sends a broadcast.

| Parameters |
|---|---|
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | `https://developer.android.com/reference/android/content/ComponentName.html` of the target broadcast receiver that is expected to have been passed in the `actionSendBroadcast` method call. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasSendBroadcastClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasSendBroadcastClickAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasSendBroadcastClickAction(
    intent: Intent
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that sends a broadcast.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent for sending broadcast that is expected to have been passed in the `actionSendBroadcast` method call. Note: intent is only matched using filterEquals. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasSendBroadcastClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasSendBroadcastClickAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasSendBroadcastClickAction(
    intentAction: String,
    componentName: ComponentName? = null
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that sends a broadcast.

| Parameters |
|---|---|
| `intentAction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the intent action of the broadcast receiver that is expected to have been passed in the `actionSendBroadcast` method call. |
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html? = null` | optional `https://developer.android.com/reference/android/content/ComponentName.html` of the target broadcast receiver that is expected to have been passed in the `actionSendBroadcast` method call. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasStartActivityClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasStartActivityClickAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasStartActivityClickAction(
    intent: Intent,
    parameters: ActionParameters = actionParametersOf(),
    activityOptions: Bundle? = null
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that starts an activity.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent for launching an activity that is expected to have been passed in the `actionStartActivity` method call |
| `parameters: https://developer.android.com/reference/kotlin/androidx/glance/action/ActionParameters = actionParametersOf()` | the parameters associated with the action that are expected to have been passed in the `actionStartActivity` method call |
| `activityOptions: https://developer.android.com/reference/android/os/Bundle.html? = null` | Additional options built from an `https://developer.android.com/reference/android/app/ActivityOptions.html` to apply to an activity start. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasStartServiceClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasStartServiceClickAction)

```
inline fun <T : Service> GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasStartServiceClickAction(
    isForegroundService: Boolean = false
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that starts a service.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/android/app/Service.html>` | class of the service to launch that is expected to have been passed in the `actionStartService` method call. |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if the service to launch is expected to have been set as foreground service in the `actionStartService` method call. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasStartServiceClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasStartServiceClickAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasStartServiceClickAction(
    componentName: ComponentName,
    isForegroundService: Boolean = false
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that starts a service.

| Parameters |
|---|---|
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | component of the service to launch that is expected to have been passed in the `actionStartService` method call. |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if the service to launch is expected to have been set as foreground service in the `actionStartService` method call. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertHasStartServiceClickAction

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertHasStartServiceClickAction) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertHasStartServiceClickAction(
    intent: Intent,
    isForegroundService: Boolean = false
): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node has a clickable set with action that starts a service.

| Parameters |
|---|---|
| `intent: https://developer.android.com/reference/android/content/Intent.html` | the intent for launching the service that is expected to have been passed in the `actionStartService` method call. |
| `isForegroundService: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if the service to launch is expected to have been set as foreground service in the `actionStartService` method call. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertIsChecked

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertIsChecked) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertIsChecked(): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node is checkable and is checked.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |

### GlanceNodeAssertion.assertIsNotChecked

Artifact: [androidx.glance:glance-appwidget-testing](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/testing/unit/UnitTestAssertionExtensions.kt+function:assertIsNotChecked) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

```
fun GlanceNodeAssertion<MappedNode, GlanceMappedNode>.assertIsNotChecked(): GlanceNodeAssertion<MappedNode, GlanceMappedNode>
```

Asserts that a given node is checkable and is not checked.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-assertion-error/index.html` | if the matcher does not match or the node can no longer be found. |