Skip to content

Commit 3646b6a

Browse files
authored
Remove custom background color support from test spacer (#2769)
1 parent f010199 commit 3646b6a

File tree

10 files changed

+19
-21
lines changed

10 files changed

+19
-21
lines changed

redwood-layout-composeui/src/androidUnitTest/kotlin/app/cash/redwood/layout/composeui/ComposeUiFlexContainerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ class ComposeUiFlexContainerTest(
7272
applyDefaults()
7373
}
7474

75-
override fun spacer(backgroundColor: Int): Spacer<@Composable (Modifier) -> Unit> {
75+
override fun spacer(): Spacer<@Composable (Modifier) -> Unit> {
7676
return ComposeUiSpacer().apply {
77-
testOnlyModifier = Modifier.background(Color(backgroundColor))
77+
testOnlyModifier = Modifier.background(Color(defaultBackgroundColor))
7878
}
7979
}
8080

redwood-layout-shared-test/src/commonMain/kotlin/app/cash/redwood/layout/AbstractFlexContainerTest.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ abstract class AbstractFlexContainerTest<T : Any> {
119119
/** Returns a non-lazy flex container column, even if the test is for a LazyList. */
120120
abstract fun column(): Column<T>
121121

122-
abstract fun spacer(
123-
backgroundColor: Int = argb(17, 0, 0, 0),
124-
): Spacer<T>
122+
abstract fun spacer(): Spacer<T>
125123

126124
abstract fun snapshotter(widget: T): Snapshotter
127125

Lines changed: 2 additions & 2 deletions
Loading

redwood-layout-uiview/src/commonTest/kotlin/app/cash/redwood/layout/uiview/UIViewFlexContainerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ class UIViewFlexContainerTest(
7878
applyDefaults()
7979
}
8080

81-
override fun spacer(backgroundColor: Int): Spacer<UIView> {
81+
override fun spacer(): Spacer<UIView> {
8282
return UIViewRedwoodLayoutWidgetFactory().Spacer()
8383
.apply {
84-
value.backgroundColor = backgroundColor.toUIColor()
84+
value.backgroundColor = defaultBackgroundColor.toUIColor()
8585
}
8686
}
8787

redwood-layout-view/src/test/kotlin/app/cash/redwood/layout/view/ViewFlexContainerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ class ViewFlexContainerTest(
7171
applyDefaults()
7272
}
7373

74-
override fun spacer(backgroundColor: Int): Spacer<View> {
74+
override fun spacer(): Spacer<View> {
7575
return ViewSpacer(paparazzi.context)
7676
.apply {
77-
value.setBackgroundColor(backgroundColor)
77+
value.setBackgroundColor(defaultBackgroundColor)
7878
}
7979
}
8080

Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

redwood-lazylayout-composeui/src/androidUnitTest/kotlin/app/cash/redwood/layout/composeui/ComposeUiLazyListTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ class ComposeUiLazyListTest(
6969
return ComposeUiRedwoodLayoutWidgetFactory().Column()
7070
}
7171

72-
override fun spacer(backgroundColor: Int): Spacer<@Composable (Modifier) -> Unit> {
72+
override fun spacer(): Spacer<@Composable (Modifier) -> Unit> {
7373
return ComposeUiRedwoodLayoutWidgetFactory().Spacer().apply {
7474
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
7575
(this as ComposeUiSpacer).testOnlyModifier =
76-
Modifier.background(Color(backgroundColor))
76+
Modifier.background(Color(defaultBackgroundColor))
7777
}
7878
}
7979

redwood-lazylayout-uiview/src/commonTest/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyListAsFlexContainerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class UIViewLazyListAsFlexContainerTest(
5151

5252
override fun column() = UIViewRedwoodLayoutWidgetFactory().Column()
5353

54-
override fun spacer(backgroundColor: Int): Spacer<UIView> {
54+
override fun spacer(): Spacer<UIView> {
5555
return UIViewRedwoodLayoutWidgetFactory().Spacer()
5656
.apply {
57-
value.backgroundColor = backgroundColor.toUIColor()
57+
value.backgroundColor = defaultBackgroundColor.toUIColor()
5858
}
5959
}
6060

redwood-lazylayout-view/src/test/kotlin/app/cash/redwood/lazylayout/view/ViewLazyListAsFlexContainerTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ class ViewLazyListAsFlexContainerTest(
6969
return ViewRedwoodLayoutWidgetFactory(paparazzi.context).Column()
7070
}
7171

72-
override fun spacer(backgroundColor: Int): Spacer<View> {
72+
override fun spacer(): Spacer<View> {
7373
return ViewRedwoodLayoutWidgetFactory(paparazzi.context).Spacer()
7474
.apply {
75-
value.setBackgroundColor(backgroundColor)
75+
value.setBackgroundColor(defaultBackgroundColor)
7676
}
7777
}
7878

0 commit comments

Comments
 (0)