Add spinner options to "All apps"
Spinner options only shows when there is any disabled or instant apps. Fix: 264228237 Test: Manually with Settings Test: Unit test Change-Id: I9f916c1076b2d754b8c5f30244eac5d5c0bc78f4
This commit is contained in:
@@ -121,7 +121,7 @@ class AllAppListTest {
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
@Test
|
||||
fun allAppListModel_transform() = runTest {
|
||||
val listModel = AllAppListModel { stateOf(SUMMARY) }
|
||||
val listModel = AllAppListModel(context) { stateOf(SUMMARY) }
|
||||
|
||||
val recordListFlow = listModel.transform(flowOf(USER_ID), flowOf(listOf(APP)))
|
||||
|
||||
@@ -132,7 +132,7 @@ class AllAppListTest {
|
||||
|
||||
@Test
|
||||
fun allAppListModel_getSummary() {
|
||||
val listModel = AllAppListModel { stateOf(SUMMARY) }
|
||||
val listModel = AllAppListModel(context) { stateOf(SUMMARY) }
|
||||
|
||||
lateinit var summaryState: State<String>
|
||||
composeTestRule.setContent {
|
||||
@@ -142,6 +142,23 @@ class AllAppListTest {
|
||||
assertThat(summaryState.value).isEqualTo(SUMMARY)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun allAppListModel_getSummaryWhenDisabled() {
|
||||
val listModel = AllAppListModel(context) { stateOf(SUMMARY) }
|
||||
val disabledApp = ApplicationInfo().apply {
|
||||
packageName = PACKAGE_NAME
|
||||
enabled = false
|
||||
}
|
||||
|
||||
lateinit var summaryState: State<String>
|
||||
composeTestRule.setContent {
|
||||
summaryState =
|
||||
listModel.getSummary(option = 0, record = AppRecordWithSize(app = disabledApp))
|
||||
}
|
||||
|
||||
assertThat(summaryState.value).isEqualTo("$SUMMARY${System.lineSeparator()}Disabled")
|
||||
}
|
||||
|
||||
private fun getAppListInput(): AppListInput<AppRecordWithSize> {
|
||||
lateinit var input: AppListInput<AppRecordWithSize>
|
||||
composeTestRule.setContent {
|
||||
@@ -157,7 +174,7 @@ class AllAppListTest {
|
||||
private fun setItemContent() {
|
||||
composeTestRule.setContent {
|
||||
fakeNavControllerWrapper.Wrapper {
|
||||
with(AllAppListModel()) {
|
||||
with(AllAppListModel(context)) {
|
||||
AppListItemModel(
|
||||
record = AppRecordWithSize(app = APP),
|
||||
label = LABEL,
|
||||
|
||||
Reference in New Issue
Block a user