Do not show "Not installed for this user" summary for archived app
Test: AllAppListTest Bug: 304255511 Change-Id: I806fed91d4716e8e21f70ec1ad8572f246c7f031
This commit is contained in:
@@ -136,7 +136,7 @@ class AllAppListModel(
|
|||||||
derivedStateOf {
|
derivedStateOf {
|
||||||
storageSummary.value +
|
storageSummary.value +
|
||||||
when {
|
when {
|
||||||
!record.app.installed -> {
|
!record.app.installed && !record.app.isArchived -> {
|
||||||
System.lineSeparator() + context.getString(R.string.not_installed)
|
System.lineSeparator() + context.getString(R.string.not_installed)
|
||||||
}
|
}
|
||||||
isDisabled(record) -> {
|
isDisabled(record) -> {
|
||||||
|
@@ -216,6 +216,23 @@ class AllAppListTest {
|
|||||||
composeTestRule.onNodeWithText(LABEL).assertIsDisplayed()
|
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> {
|
private fun getAppListInput(): AppListInput<AppRecordWithSize> {
|
||||||
lateinit var input: AppListInput<AppRecordWithSize>
|
lateinit var input: AppListInput<AppRecordWithSize>
|
||||||
composeTestRule.setContent {
|
composeTestRule.setContent {
|
||||||
|
Reference in New Issue
Block a user