Skip to content

Commit

Permalink
Update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitozgumus committed Nov 28, 2024
1 parent 32d9c85 commit 4f25a84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.trendyol.transmission.features.colorpicker

import androidx.compose.ui.graphics.Color
import com.trendyol.transmission.components.features.ColorPickerUiState
import com.trendyol.transmission.components.features.colorpicker.ColorPickerEffect
import com.trendyol.transmission.components.features.colorpicker.ColorPickerSignal
import com.trendyol.transmission.components.features.colorpicker.ColorPickerTransformer
import com.trendyol.transmission.transformer.util.TestCoroutineRule
import com.trendyol.transmission.components.features.ColorPickerUiState
import com.trendyol.transmissiontest.attachToRouter
import com.trendyol.transmissiontest.test
import org.junit.Before
Expand Down Expand Up @@ -70,8 +70,9 @@ class ColorPickerTransformerTest {

@Test
fun `GIVEN inputTransformer, WHEN SelectColor signal is sent, THEN SelectedColorUpdate is sent to MultiOutputTransformer`() {
sut.attachToRouter().test(signal = ColorPickerSignal.SelectColor(3, Color.Blue)) {
assertTrue { effectStream.last() is ColorPickerEffect.SelectedColorUpdate }
}
sut.attachToRouter()
.test(signal = ColorPickerSignal.SelectColor(3, Color.Blue)) {
assertTrue { effectStream.last() is ColorPickerEffect.SelectedColorUpdate }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.trendyol.transmission.components.features.output.OutputTransformer
import com.trendyol.transmission.transformer.util.TestCoroutineRule
import com.trendyol.transmission.components.features.ColorPickerUiState
import com.trendyol.transmission.components.features.OutputUiState
import com.trendyol.transmission.components.features.colorpicker.ColorPickerTransformer
import com.trendyol.transmissiontest.attachToRouter
import com.trendyol.transmissiontest.test
import org.junit.Before
Expand Down Expand Up @@ -45,8 +46,8 @@ class OutputTransformerTest {
@Test
fun `GIVEN sut, WHEN inputUpdate effect comes and ColorPickerUIState exists, THEN RouterPayloadEffect should be published`() {
sut.attachToRouter()
.register {
addQueryData(ColorPickerUiState(), key = "ColorPickerUiState")
.registerData(ColorPickerTransformer.holderContract) {
ColorPickerUiState()
}
.test(effect = InputEffect.InputUpdate("test")) {
assertEquals(OutputUiState(outputText = "test"), dataStream[1])
Expand Down

0 comments on commit 4f25a84

Please sign in to comment.