Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b4b63d1
Add Turbine library to compose module
andremion Sep 16, 2025
4a4d34d
Add unit tests for ChannelHeaderViewModel
andremion Sep 16, 2025
e92ebfa
Add unit tests for ChannelAttachmentsViewModel
andremion Sep 16, 2025
00cb434
Add unit tests for ChannelInfoMemberViewModel
andremion Sep 16, 2025
2fc1816
Add unit tests for ChannelInfoViewModel
andremion Sep 16, 2025
8a77f56
Add unit tests for ChannelAttachmentsViewModelFactory
andremion Sep 16, 2025
7384208
Add unit tests for ChannelHeaderViewModelFactory
andremion Sep 16, 2025
4d8c42e
Add unit tests for ChannelInfoViewModelFactory
andremion Sep 16, 2025
8a0fe1f
Add unit tests for ChannelInfoMemberViewModelFactory
andremion Sep 16, 2025
c05cf46
Add unit tests for ChannelViewModelFactory
andremion Sep 16, 2025
eea27b8
Add unit tests and preview for GiphyAttachmentContent
andremion Sep 16, 2025
8b2ee54
Add previews and unit tests for media attachment content
andremion Sep 16, 2025
7cc75a6
Add unit tests for PinnedMessageListViewModel
andremion Sep 17, 2025
0f50eb5
Add unit tests for MentionListViewModel
andremion Sep 17, 2025
b9c5f68
Add unit tests for MentionListViewModelFactory
andremion Sep 17, 2025
153b7be
Add unit tests for MessagesViewModelFactory
andremion Sep 17, 2025
0477caa
Add unit tests for ThreadsViewModelFactory and ThreadListViewModel
andremion Sep 17, 2025
cba1886
Add unit tests for MentionSuggestionList
andremion Sep 17, 2025
6e87d90
Remove the fixed height modifier in `FileUploadItem`
andremion Sep 17, 2025
008eee9
Add unit tests for CommandSuggestionList
andremion Sep 17, 2025
9324a54
Integrate Kover for better code coverage reporting
andremion Sep 18, 2025
c4f79ad
Update snapshots
andremion Sep 19, 2025
c04676b
Increase code coverage of ChannelsScreen
andremion Sep 19, 2025
4e15324
Add unit tests for PinnedMessagesScreen and update PinnedMessageListS…
andremion Sep 19, 2025
48fc390
Add unit tests for MessageComposerScreen
andremion Sep 19, 2025
65543ee
Add unit tests for ChatsScreen
andremion Sep 19, 2025
8183c2d
Increase coverage of CopyToClipboardHandlerImpl
andremion Sep 22, 2025
7e25281
Increase code coverage of ChannelsScreen
andremion Sep 22, 2025
a136196
Add unit tests for ChatsScreen
andremion Sep 22, 2025
1aa360b
Add unit tests for MessagesScreen
andremion Sep 22, 2025
463c31f
Deprecate AudioWaveVSeekbar component
andremion Sep 22, 2025
3f4ef65
Add unit tests and preview for AudioWaveVSeekbar component
andremion Sep 22, 2025
d0ddf04
Add unit tests for MessageModerationDialog
andremion Sep 22, 2025
cd6c9b7
Add previews and snapshot tests for MessageComposerRecordingContent
andremion Sep 22, 2025
850dea8
Rename SuggestionLazyList to MentionSuggestionLazyList for clarity
andremion Sep 23, 2025
ba5e984
Refactor PinnedMessageListState to use default values and update tests
andremion Sep 23, 2025
300f434
Refactor view models to use property accessors for controller and state
andremion Sep 23, 2025
01342b5
code review
andremion Sep 23, 2025
54ae703
Log only failed tests
andremion Sep 23, 2025
09e7d70
Remove MessageComposerCommandSuggestionListHeader component factory
andremion Sep 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@
### 🐞 Fixed

### ⬆️ Improved
- Remove the fixed height modifier in `FileUploadItem`. [#5932](https://github.com/GetStream/stream-chat-android/pull/5932)

### ✅ Added

### ⚠️ Changed
- Deprecate unused component `AudioWaveVSeekbar`. [#5932](https://github.com/GetStream/stream-chat-android/pull/5932)

### ❌ Removed

Expand Down
1 change: 1 addition & 0 deletions DEPRECATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This document lists deprecated constructs in the SDK, with their expected time

| API / Feature | Deprecated (warning) | Deprecated (error) | Removed | Notes |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|-----------------------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `AudioWaveVSeekbar`<br/>*compose* | 2025.09.22 ⌛ | | | |
| `AttachmentType.LINK` constant | 2025.09.08 ⌛ | | | This property has been deprecated. The attachment of type 'LINK' is not officially supported, and Attachment.type can never have a value equal to "link". |
| `Attachment.isLink()` method | 2025.09.08 ⌛ | | | This method has been deprecated. The attachment of type 'LINK' is not officially supported, and Attachment.type can never have a value equal to "link". |
| `StreamColors.linkBackground` property | 2025.08.12 ⌛ | | | This property has been deprecated. Please use `MessageTheme.linkBackgroundColor` instead. |
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ plugins {
alias(libs.plugins.shot) apply false
alias(libs.plugins.androidx.navigation) apply false
alias(libs.plugins.sonarqube) apply false
alias(libs.plugins.kover) apply false
id("io.getstream.chat.UnitTestsPlugin")
id("io.getstream.chat.ReleasePlugin")
id("io.getstream.chat.ChangelogReleaseSectionPlugin")
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ timber = "5.0.1"
turbine = "1.2.0"
work = "2.9.1"
playServicesLocation = "21.3.0"
kover = "0.9.2"

[libraries]
allure-kotlin-model = { module = "io.qameta.allure:allure-kotlin-model", version.ref = "allureKotlin"}
Expand Down Expand Up @@ -244,3 +245,4 @@ shot = { id = "shot", version.ref = "shot"}
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube"}
spotless = { id = "com.diffplug.spotless", version.ref = "spotless"}
paparazzi = { id = "app.cash.paparazzi", version.ref = "paparazzi"}
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover"}
104 changes: 57 additions & 47 deletions scripts/coverage.gradle
Original file line number Diff line number Diff line change
@@ -1,62 +1,72 @@
if (!rootProject.ext.sonar.ignoreModules.contains(name)) {
apply plugin: 'jacoco'
if (!rootProject.ext.sonar.ignoreModules.contains(name) && file("src/test").exists()) {
apply plugin: "org.jetbrains.kotlinx.kover"
apply plugin: "org.sonarqube"

def isCore = (name == 'stream-chat-android-core')
def isCompose = (name == 'stream-chat-android-compose')
def testTask = isCore ? "test" : isCompose ? "verifyPaparazziDebug" : "testDebugUnitTest"
def jacocoResults = "${buildDir}/reports/jacoco/report.xml"

if (hasProperty('android')) {
android {
buildTypes {
debug {
testCoverageEnabled = true
enableUnitTestCoverage = true
enableAndroidTestCoverage true
afterEvaluate {
def isAndroidModule = plugins.hasPlugin("com.android.library") || plugins.hasPlugin("com.android.application")
def hasPaparazziPlugin = plugins.hasPlugin("app.cash.paparazzi")

if (isAndroidModule) {
android {
buildTypes {
debug {
testCoverageEnabled = true
enableUnitTestCoverage = true
enableAndroidTestCoverage true
}
}
}
}
}

afterEvaluate {
tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
def testTaskName = isAndroidModule
? (hasPaparazziPlugin ? "verifyPaparazziDebug" : "testDebugUnitTest")
: "test"

tasks.register("testCoverage", JacocoReport) {
dependsOn testTask
tasks.register("testCoverage") {
group = "verification"
description = "Run module-specific tests and generate coverage reports"
dependsOn(testTaskName)

reports {
xml.required.set(true)
xml.outputLocation.set(file(jacocoResults))
if (isAndroidModule) {
dependsOn "koverXmlReportDebug", "koverHtmlReportDebug"
} else {
dependsOn "koverXmlReport", "koverHtmlReport"
}
}

executionData.setFrom(fileTree(dir: buildDir, includes: [
"outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec",
"jacoco/test.exec"
]))

def sources = isCore ? sourceSets.main.java.srcDirs : android.sourceSets.main.java.srcDirs
sourceDirectories.setFrom(files(sources))
classDirectories.setFrom(files([
fileTree(
dir: "${buildDir}/tmp/kotlin-classes/debug",
excludes: rootProject.ext.sonar.excludeFilter
),
fileTree(
dir: "${buildDir}/classes/kotlin/main",
excludes: rootProject.ext.sonar.excludeFilter
)
]))
kover {
reports {
verify {
warningInsteadOfFailure = true
}
filters {
excludes {
// Existing sonar excludes
classes(rootProject.ext.sonar.excludeFilter as String[])
// Exclude Compose-generated singletons
classes("*ComposableSingletons*")
// Exclude Compose previews
annotatedBy("androidx.compose.ui.tooling.preview.Preview")
}
}
}
}
}

sonarqube {
properties {
property "sonar.junit.reportPaths", "${buildDir}/test-results/${testTask}"
property "sonar.coverage.jacoco.xmlReportPaths", jacocoResults
sonarqube {
properties {
def mainSources = []
if (file("src/main/java").exists()) mainSources += "src/main/java"
if (file("src/main/kotlin").exists()) mainSources += "src/main/kotlin"

property "sonar.sources", mainSources.join(",")

def xmlReportPaths = isAndroidModule
? "$buildDir/reports/kover/reportDebug.xml"
: "$buildDir/reports/kover/report.xml"

property "sonar.junit.reportPaths", "${buildDir}/test-results/${testTaskName}"
property "sonar.coverage.jacoco.xmlReportPaths", xmlReportPaths
}
}
}
}
2 changes: 1 addition & 1 deletion scripts/sonar.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ext.sonar = [
'stream-chat-android-ui-components-sample',
'stream-chat-android-client-test',
'stream-chat-android-ui-uitests',
'metrics'
'stream-chat-android-metrics'
],
excludeFilter : [
'**/test/**',
Expand Down
36 changes: 34 additions & 2 deletions stream-chat-android-compose/api/stream-chat-android-compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,15 @@ public final class io/getstream/chat/android/compose/ui/attachments/content/Comp
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/attachments/content/ComposableSingletons$GiphyAttachmentContentKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/attachments/content/ComposableSingletons$GiphyAttachmentContentKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/attachments/content/ComposableSingletons$ImageAttachmentPreviewContentKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/attachments/content/ComposableSingletons$ImageAttachmentPreviewContentKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
Expand All @@ -535,9 +544,17 @@ public final class io/getstream/chat/android/compose/ui/attachments/content/Comp
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/attachments/content/ComposableSingletons$MediaAttachmentContentKt;
public static field lambda-1 Lkotlin/jvm/functions/Function3;
public static field lambda-2 Lkotlin/jvm/functions/Function3;
public static field lambda-3 Lkotlin/jvm/functions/Function2;
public static field lambda-4 Lkotlin/jvm/functions/Function2;
public static field lambda-5 Lkotlin/jvm/functions/Function2;
public static field lambda-6 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda-3$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-4$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-5$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-6$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/attachments/content/ComposableSingletons$MediaAttachmentPreviewContentKt {
Expand Down Expand Up @@ -2036,8 +2053,10 @@ public final class io/getstream/chat/android/compose/ui/components/suggestions/c
public final class io/getstream/chat/android/compose/ui/components/suggestions/commands/ComposableSingletons$CommandSuggestionListKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/suggestions/commands/ComposableSingletons$CommandSuggestionListKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/components/suggestions/mentions/ComposableSingletons$MentionSuggestionItemKt {
Expand All @@ -2053,6 +2072,13 @@ public final class io/getstream/chat/android/compose/ui/components/suggestions/m
public final fun getLambda-4$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
}

public final class io/getstream/chat/android/compose/ui/components/suggestions/mentions/ComposableSingletons$MentionSuggestionListKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/suggestions/mentions/ComposableSingletons$MentionSuggestionListKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/components/suggestions/mentions/MentionSuggestionItemKt {
public static final fun MentionSuggestionItem (Lio/getstream/chat/android/models/User;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V
}
Expand Down Expand Up @@ -2484,9 +2510,15 @@ public final class io/getstream/chat/android/compose/ui/messages/composer/intern
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/messages/composer/internal/ComposableSingletons$DefaultMessageComposerRecordingContentKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
public static field lambda-2 Lkotlin/jvm/functions/Function2;
public static field lambda-3 Lkotlin/jvm/functions/Function2;
public static field lambda-4 Lkotlin/jvm/functions/Function2;
public static field lambda-5 Lkotlin/jvm/functions/Function2;
public fun <init> ()V
public final fun getLambda-1$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-3$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-4$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda-5$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/messages/composer/internal/DefaultMessageComposerRecordingContentKt {
Expand Down Expand Up @@ -5014,8 +5046,8 @@ public final class io/getstream/chat/android/compose/viewmodel/threads/ThreadLis
public final class io/getstream/chat/android/compose/viewmodel/threads/ThreadsViewModelFactory : androidx/lifecycle/ViewModelProvider$Factory {
public static final field $stable I
public fun <init> ()V
public fun <init> (III)V
public synthetic fun <init> (IIIILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (IIILio/getstream/chat/android/client/ChatClient;)V
public synthetic fun <init> (IIILio/getstream/chat/android/client/ChatClient;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun create (Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
}

10 changes: 10 additions & 0 deletions stream-chat-android-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ android {

resourcePrefix = "stream_compose_"

testOptions {
unitTests {
isIncludeAndroidResources = true
unitTests.isReturnDefaultValues = true
}
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
Expand Down Expand Up @@ -110,6 +117,7 @@ dependencies {
testImplementation(project(":stream-chat-android-test"))
testImplementation(testFixtures(project(":stream-chat-android-core")))
testImplementation(project(":stream-chat-android-previewdata"))
testImplementation(libs.androidx.compose.ui.test.junit4)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testRuntimeOnly(libs.junit.jupiter.engine)
Expand All @@ -118,6 +126,8 @@ dependencies {
testImplementation(libs.kluent)
testImplementation(libs.mockito)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.turbine)
testImplementation(libs.robolectric)

detektPlugins(libs.detekt.formatting)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -105,7 +104,6 @@ public fun FileUploadItem(
Row(
Modifier
.fillMaxWidth()
.height(50.dp)
.padding(vertical = 8.dp, horizontal = 8.dp),
verticalAlignment = Alignment.CenterVertically,
) {
Expand Down
Loading
Loading