Skip to content

Commit 8cf9bfc

Browse files
committed
nitpick: reformat the file
1 parent 2263ad6 commit 8cf9bfc

File tree

1 file changed

+38
-44
lines changed

1 file changed

+38
-44
lines changed

app/src/androidTest/java/org/kabiri/android/usbterminal/MainActivityAndroidTest.kt

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ import org.junit.Rule
1515
import org.junit.Test
1616
import org.junit.runner.RunWith
1717

18-
1918
@RunWith(AndroidJUnit4::class)
2019
internal class MainActivityAndroidTest {
21-
2220
@get:Rule
2321
var rule = activityScenarioRule<MainActivity>()
2422

2523
private fun ensureMenuIsAccessible(
2624
menuItemId: Int,
2725
onVisible: () -> Unit,
28-
onOverflow: () -> Unit
26+
onOverflow: () -> Unit,
2927
) {
3028
try {
3129
// Try to find the menu item first
@@ -49,57 +47,53 @@ internal class MainActivityAndroidTest {
4947
}
5048

5149
@Test
52-
fun checkActionMenuItemSettingsIsDisplayed() = ensureMenuIsAccessible(
53-
menuItemId = R.id.actionSettings,
54-
onVisible = {
55-
56-
// assert
57-
onView(withId(R.id.actionSettings)).check(matches(isDisplayed()))
58-
},
59-
onOverflow = {
60-
61-
// assert
62-
onView(withText(R.string.title_settings)).check(matches(isDisplayed()))
63-
}
64-
)
50+
fun checkActionMenuItemSettingsIsDisplayed() =
51+
ensureMenuIsAccessible(
52+
menuItemId = R.id.actionSettings,
53+
onVisible = {
54+
// assert
55+
onView(withId(R.id.actionSettings)).check(matches(isDisplayed()))
56+
},
57+
onOverflow = {
58+
// assert
59+
onView(withText(R.string.title_settings)).check(matches(isDisplayed()))
60+
},
61+
)
6562

6663
@Test
67-
fun checkActionMenuItemConnectIsDisplayed() = ensureMenuIsAccessible(
68-
menuItemId = R.id.actionSettings,
69-
onVisible = {
70-
71-
// assert
72-
onView(withId(R.id.actionConnect)).check(matches(isDisplayed()))
73-
},
74-
onOverflow = {
75-
76-
// assert
77-
onView(withText(R.string.title_connect)).check(matches(isDisplayed()))
78-
}
79-
)
64+
fun checkActionMenuItemConnectIsDisplayed() =
65+
ensureMenuIsAccessible(
66+
menuItemId = R.id.actionSettings,
67+
onVisible = {
68+
// assert
69+
onView(withId(R.id.actionConnect)).check(matches(isDisplayed()))
70+
},
71+
onOverflow = {
72+
// assert
73+
onView(withText(R.string.title_connect)).check(matches(isDisplayed()))
74+
},
75+
)
8076

8177
@Test
82-
fun checkActionMenuItemDisconnectIsDisplayed() = ensureMenuIsAccessible(
83-
menuItemId = R.id.actionSettings,
84-
onVisible = {
85-
86-
// assert
87-
onView(withId(R.id.actionDisconnect)).check(matches(isDisplayed()))
88-
},
89-
onOverflow = {
90-
91-
// assert
92-
onView(withText(R.string.title_disconnect)).check(matches(isDisplayed()))
93-
}
94-
)
78+
fun checkActionMenuItemDisconnectIsDisplayed() =
79+
ensureMenuIsAccessible(
80+
menuItemId = R.id.actionSettings,
81+
onVisible = {
82+
// assert
83+
onView(withId(R.id.actionDisconnect)).check(matches(isDisplayed()))
84+
},
85+
onOverflow = {
86+
// assert
87+
onView(withText(R.string.title_disconnect)).check(matches(isDisplayed()))
88+
},
89+
)
9590

9691
@Test
9792
fun clickingSettingsOpensSettingsBottomSheet() {
9893
// arrange
9994
ensureMenuIsAccessible(
10095
menuItemId = R.id.actionSettings,
10196
onVisible = {
102-
10397
// act
10498
onView(withId(R.id.actionSettings)).perform(click())
10599

@@ -112,7 +106,7 @@ internal class MainActivityAndroidTest {
112106

113107
// assert
114108
onView(withId(R.id.composeViewSettingContent)).check(matches(isDisplayed()))
115-
}
109+
},
116110
)
117111
}
118112
}

0 commit comments

Comments
 (0)