Skip to content

Commit

Permalink
Merge pull request android#329 from JoseAlcerreca/jetchat_ktlint
Browse files Browse the repository at this point in the history
[Jetchat] Enables --android flag in ktlint
  • Loading branch information
JoseAlcerreca authored Dec 16, 2020
2 parents 6c66083 + 0ef7f45 commit 4becf15
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ class NavigationTest {
// Check profile is displayed
assertEquals(navController.currentDestination?.id, R.id.nav_profile)
// Extra UI check
composeTestRule.onNodeWithText(activity.getString(R.string.textfield_hint)).assertIsDisplayed()
composeTestRule
.onNodeWithText(activity.getString(R.string.textfield_hint))
.assertIsDisplayed()

// Press back
Espresso.pressBack()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,23 @@ class UserInputTest {
}

private fun clickOnTextField() =
composeTestRule.onNodeWithContentDescription(activity.getString(R.string.textfield_desc))
composeTestRule
.onNodeWithContentDescription(activity.getString(R.string.textfield_desc))
.performClick()

private fun openEmojiSelector() =
composeTestRule.onNodeWithContentDescription(activity.getString(R.string.emoji_selector_bt_desc))
composeTestRule
.onNodeWithContentDescription(activity.getString(R.string.emoji_selector_bt_desc))
.performClick()

private fun assertEmojiSelectorIsDisplayed() =
composeTestRule.onNodeWithContentDescription(activity.getString(R.string.emoji_selector_desc))
composeTestRule
.onNodeWithContentDescription(activity.getString(R.string.emoji_selector_desc))
.assertIsDisplayed()

private fun assertEmojiSelectorDoesNotExist() =
composeTestRule.onNodeWithContentDescription(activity.getString(R.string.emoji_selector_desc))
composeTestRule
.onNodeWithContentDescription(activity.getString(R.string.emoji_selector_desc))
.assertDoesNotExist()

private fun findSendButton() = composeTestRule.onNodeWithText(activity.getString(R.string.send))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ fun ColumnScope.JetchatDrawer(onProfileClicked: (String) -> Unit, onChatClicked:
ChatItem("droidcon-nyc", false) { onChatClicked("droidcon-nyc") }
DrawerItemHeader("Recent Profiles")
ProfileItem("Ali Conors (you)", meProfile.photo) { onProfileClicked(meProfile.userId) }
ProfileItem("Taylor Brooks", colleagueProfile.photo) { onProfileClicked(colleagueProfile.userId) }
ProfileItem("Taylor Brooks", colleagueProfile.photo) {
onProfileClicked(colleagueProfile.userId)
}
}

@Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ class ConversationUiState(
}

@Immutable
data class Message(val author: String, val content: String, val timestamp: String, val image: Int? = null)
data class Message(
val author: String,
val content: String,
val timestamp: String,
val image: Int? = null
)
3 changes: 1 addition & 2 deletions Jetchat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ subprojects {
target '**/*.kt'
targetExclude("$buildDir/**/*.kt")
targetExclude('bin/**/*.kt')

ktlint(Versions.ktlint)
ktlint(Versions.ktlint).userData([android: "true"])
licenseHeaderFile rootProject.file('spotless/copyright.kt')
}
}
Expand Down

0 comments on commit 4becf15

Please sign in to comment.