diff options
Diffstat (limited to 'library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardListWidgetsRemoteOperationIT.kt')
-rw-r--r-- | library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardListWidgetsRemoteOperationIT.kt | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardListWidgetsRemoteOperationIT.kt b/library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardListWidgetsRemoteOperationIT.kt new file mode 100644 index 00000000..df163e53 --- /dev/null +++ b/library/src/androidTest/java/com/nextcloud/android/lib/resources/dashboard/DashboardListWidgetsRemoteOperationIT.kt @@ -0,0 +1,47 @@ +/* + * + * Nextcloud Android client application + * + * @author Tobias Kaminsky + * Copyright (C) 2022 Tobias Kaminsky + * Copyright (C) 2022 Nextcloud GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package com.nextcloud.android.lib.resources.dashboard + +import com.owncloud.android.AbstractIT +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Test + +class DashboardListWidgetsRemoteOperationIT : AbstractIT() { + @Test + fun list() { + val result = DashboardListWidgetsRemoteOperation().execute(nextcloudClient) + assertTrue(result.isSuccess) + + assertTrue(result.resultData.isNotEmpty()) + + assertTrue(result.resultData["recommendations"]?.buttons?.getOrNull(0) == null) + + assertTrue(result.resultData["notes"]?.buttons?.getOrNull(0)?.text?.isNotEmpty() == true) + assertTrue(result.resultData["notes"]?.buttons?.getOrNull(0)?.type == DashBoardButtonType.NEW) + assertTrue(result.resultData["notes"]?.roundIcons == false) + + assertEquals(0, result.resultData["activity"]?.buttons?.size) + assertTrue(result.resultData["activity"]?.roundIcons == true) + } +} |