fix spotless errors with line length

pull/402/head
JanFidor 3 years ago
parent 749feb714e
commit 3264bb50fc

@ -1,17 +1,17 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.author
@ -25,7 +25,8 @@ import com.google.samples.apps.nowinandroid.core.domain.model.FollowableAuthor
import com.google.samples.apps.nowinandroid.core.model.data.NewsResource
internal class AuthorRobot(
private val composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>
private val composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>
) {
fun setContent(authorUiState: AuthorUiState, newsUiState: NewsUiState) {
composeTestRule.setContent {

@ -101,7 +101,8 @@ class AuthorScreenTest {
}
private fun launchAuthorRobot(
composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
authorUiState: AuthorUiState,
newsUiState: NewsUiState,
func: AuthorRobot.() -> Unit

@ -1,17 +1,17 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.bookmarks
@ -35,66 +35,51 @@ import com.google.samples.apps.nowinandroid.core.model.data.NewsResource
import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState
internal class BookmarksRobot(
private val composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>
private val composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>
) {
private val removedBookmarks = mutableSetOf<String>()
fun setContent(newsFeedUiState: NewsFeedUiState) {
composeTestRule.setContent {
BookmarksScreen(
feedState = newsFeedUiState,
removeFromBookmarks = {
removedBookmarks.add(it)
}
)
BookmarksScreen(feedState = newsFeedUiState, removeFromBookmarks = {
removedBookmarks.add(it)
})
}
}
fun loadingIndicatorShown() {
composeTestRule
.onNodeWithContentDescription(
composeTestRule.activity.resources.getString(R.string.saved_loading)
)
.assertExists()
composeTestRule.onNodeWithContentDescription(
composeTestRule.activity.resources.getString(R.string.saved_loading)
).assertExists()
}
fun clickableNewsResourceExists(newsResource: NewsResource) {
composeTestRule
.onNodeWithText(
newsResource.title,
substring = true
)
.assertExists()
.assertHasClickAction()
composeTestRule.onNodeWithText(
newsResource.title, substring = true
).assertExists().assertHasClickAction()
}
fun scrollToNewsResource(newsResource: NewsResource) {
composeTestRule.onNode(hasScrollToNodeAction())
.performScrollToNode(
hasText(
newsResource.title,
substring = true
)
composeTestRule.onNode(hasScrollToNodeAction()).performScrollToNode(
hasText(
newsResource.title, substring = true
)
)
}
fun clickNewsResourceBookmark(newsResource: NewsResource) {
composeTestRule
.onAllNodesWithContentDescription(
composeTestRule.activity.getString(
com.google.samples.apps.nowinandroid.core.ui.R.string.unbookmark
)
).filter(
hasAnyAncestor(
hasText(
newsResource.title,
substring = true
)
composeTestRule.onAllNodesWithContentDescription(
composeTestRule.activity.getString(
com.google.samples.apps.nowinandroid.core.ui.R.string.unbookmark
)
).filter(
hasAnyAncestor(
hasText(
newsResource.title, substring = true
)
)
.assertCountEquals(1)
.onFirst()
.performClick()
).assertCountEquals(1).onFirst().performClick()
}
fun removedNewsResourceBookmark(newsResource: NewsResource) =

@ -75,7 +75,8 @@ class BookmarksScreenTest {
}
private fun launchBookmarksRobot(
composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
newsFeedUiState: NewsFeedUiState,
func: BookmarksRobot.() -> Unit
) = BookmarksRobot(composeTestRule).apply {

@ -1,17 +1,17 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.foryou
@ -36,7 +36,8 @@ import com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState
import com.google.samples.apps.nowinandroid.feature.foryou.R.string
internal class ForYouRobot(
private val composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>
private val composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>
) {
private val doneButtonMatcher by lazy {
hasText(composeTestRule.activity.resources.getString(string.done))

@ -185,7 +185,8 @@ class ForYouScreenTest {
}
private fun launchForYouRobot(
composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
isSyncing: Boolean,
onboardingState: OnboardingUiState,
feedState: NewsFeedUiState,

@ -1,17 +1,17 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.interests
@ -32,7 +32,8 @@ import com.google.samples.apps.nowinandroid.feature.interests.InterestsUiState
import com.google.samples.apps.nowinandroid.feature.interests.R.string
internal class InterestsRobot(
private val composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>
private val composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>
) {
private val interestsLoading = getString(string.interests_loading)
private val interestsEmptyHeader = getString(string.interests_empty_header)

@ -75,7 +75,6 @@ class InterestsScreenTest {
interestsTopicCardFollowButtonCountEquals(numberOfUnfollowedTopics)
interestsTopicCardUnfollowButtonCountEquals(numberOfFollowedTopics)
}
}
@ -119,7 +118,8 @@ class InterestsScreenTest {
}
private fun launchBookmarksRobot(
composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
uiState: InterestsUiState,
tabIndex: Int,
func: InterestsRobot.() -> Unit

@ -1,17 +1,17 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.settings
@ -24,7 +24,8 @@ import androidx.compose.ui.test.onNodeWithText
import androidx.test.ext.junit.rules.ActivityScenarioRule
internal class SettingsDialogRobot(
private val composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>
private val composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>
) {
fun setContent(settingsUiState: SettingsUiState) {
composeTestRule.setContent {

@ -82,7 +82,8 @@ class SettingsDialogTest {
}
private fun launchSettingsDialogRobot(
composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
settingsUiState: SettingsUiState,
func: SettingsDialogRobot.() -> Unit
) = SettingsDialogRobot(composeTestRule).apply {

@ -1,17 +1,17 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.samples.apps.nowinandroid.feature.topic
@ -29,7 +29,8 @@ import com.google.samples.apps.nowinandroid.core.domain.model.FollowableTopic
import com.google.samples.apps.nowinandroid.core.model.data.NewsResource
internal class TopicRobot(
private val composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>
private val composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>
) {
private val topicLoading = composeTestRule.activity.resources.getString(R.string.topic_loading)

@ -103,7 +103,8 @@ class TopicScreenTest {
}
private fun launchTopicRobot(
composeTestRule: AndroidComposeTestRule<ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
composeTestRule: AndroidComposeTestRule<
ActivityScenarioRule<ComponentActivity>, ComponentActivity>,
topicUiState: TopicUiState,
newsUiState: NewsUiState,
func: TopicRobot.() -> Unit

Loading…
Cancel
Save