Loading src/com/android/settings/spa/app/AllAppList.kt +1 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ class AllAppListModel( derivedStateOf { storageSummary.value + when { !record.app.installed -> { !record.app.installed && !record.app.isArchived -> { System.lineSeparator() + context.getString(R.string.not_installed) } isDisabled(record) -> { Loading tests/spa_unit/src/com/android/settings/spa/app/AllAppListTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,23 @@ class AllAppListTest { composeTestRule.onNodeWithText(LABEL).assertIsDisplayed() } @Test fun allAppListModel_getSummaryWhenArchived() { val listModel = AllAppListModel(context) { stateOf(SUMMARY) } val archivedApp = ApplicationInfo().apply { packageName = PACKAGE_NAME isArchived = true } lateinit var summaryState: State<String> composeTestRule.setContent { summaryState = listModel.getSummary(option = 0, record = AppRecordWithSize(app = archivedApp)) } assertThat(summaryState.value).isEqualTo(SUMMARY) } private fun getAppListInput(): AppListInput<AppRecordWithSize> { lateinit var input: AppListInput<AppRecordWithSize> composeTestRule.setContent { Loading Loading
src/com/android/settings/spa/app/AllAppList.kt +1 −1 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ class AllAppListModel( derivedStateOf { storageSummary.value + when { !record.app.installed -> { !record.app.installed && !record.app.isArchived -> { System.lineSeparator() + context.getString(R.string.not_installed) } isDisabled(record) -> { Loading
tests/spa_unit/src/com/android/settings/spa/app/AllAppListTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,23 @@ class AllAppListTest { composeTestRule.onNodeWithText(LABEL).assertIsDisplayed() } @Test fun allAppListModel_getSummaryWhenArchived() { val listModel = AllAppListModel(context) { stateOf(SUMMARY) } val archivedApp = ApplicationInfo().apply { packageName = PACKAGE_NAME isArchived = true } lateinit var summaryState: State<String> composeTestRule.setContent { summaryState = listModel.getSummary(option = 0, record = AppRecordWithSize(app = archivedApp)) } assertThat(summaryState.value).isEqualTo(SUMMARY) } private fun getAppListInput(): AppListInput<AppRecordWithSize> { lateinit var input: AppListInput<AppRecordWithSize> composeTestRule.setContent { Loading