# GlanceAppWidgetUnitTestDefaults

# GlanceAppWidgetUnitTestDefaults

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+class:androidx.glance.appwidget.testing.unit.GlanceAppWidgetUnitTestDefaults)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)

<br />

```
object GlanceAppWidgetUnitTestDefaults
```

<br />

*** ** * ** ***

Provides default values for various properties used in the Glance appWidget unit tests.

## Summary

|                                   ### Public functions                                   |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [GlanceId](https://developer.android.com/reference/kotlin/androidx/glance/GlanceId)      | [glanceId](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTestDefaults#glanceId())`()` [GlanceId](https://developer.android.com/reference/kotlin/androidx/glance/GlanceId)that can be assumed for state updates testing a Glance composable in isolation. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)              | [hostCategory](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTestDefaults#hostCategory())`()` Default category of the appWidget assumed in the unit tests.                                                                                               |
| [DpSize](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize) | [size](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTestDefaults#size())`()` Default size of the appWidget assumed in the unit tests.                                                                                                                   |

## Public functions

### glanceId

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)  

```
fun glanceId(): GlanceId
```

[GlanceId](https://developer.android.com/reference/kotlin/androidx/glance/GlanceId)that can be assumed for state updates testing a Glance composable in isolation.  

### hostCategory

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)  

```
fun hostCategory(): Int
```

Default category of the appWidget assumed in the unit tests.

The default is`WIDGET_CATEGORY_HOME_SCREEN`  

### size

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/glance#1.1.0)  

```
fun size(): DpSize
```

Default size of the appWidget assumed in the unit tests. To override the size, use the[GlanceAppWidgetUnitTest.setAppWidgetSize](https://developer.android.com/reference/kotlin/androidx/glance/appwidget/testing/unit/GlanceAppWidgetUnitTest#setAppWidgetSize(androidx.compose.ui.unit.DpSize))function.

The default`349.dp, 455.dp`is that of a 5x4 widget in Pixel 4 portrait mode.