From 964dbcf7573e180d7471a28333a5c19403b5cfed Mon Sep 17 00:00:00 2001 From: Ryan Morales Date: Mon, 25 Nov 2024 15:26:28 -0800 Subject: [PATCH] update tests: buttonStyle.buttonTextStyle to buttonStyle.textStyle --- .../aepcomposeui/style/AepButtonStyleTests.kt | 32 +++++++++---------- .../aepcomposeui/style/AepStyleValidator.kt | 2 +- .../style/SmallImageUIStyleTests.kt | 4 +-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepButtonStyleTests.kt b/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepButtonStyleTests.kt index 71cd60e3..2363c97a 100644 --- a/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepButtonStyleTests.kt +++ b/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepButtonStyleTests.kt @@ -37,7 +37,7 @@ class AepButtonStyleTests { border = mock(BorderStroke::class.java), colors = mock(ButtonColors::class.java), contentPadding = mock(PaddingValues::class.java), - buttonTextStyle = mock(AepTextStyle::class.java) + textStyle = mock(AepTextStyle::class.java) ) val overridingStyle = AepButtonStyle( modifier = Modifier.padding(16.dp).border(BorderStroke(2.dp, Color.Red)), @@ -47,7 +47,7 @@ class AepButtonStyleTests { border = mock(BorderStroke::class.java), colors = mock(ButtonColors::class.java), contentPadding = mock(PaddingValues::class.java), - buttonTextStyle = mock(AepTextStyle::class.java) + textStyle = mock(AepTextStyle::class.java) ) val result = AepButtonStyle.merge(defaultStyle, overridingStyle) @@ -59,12 +59,12 @@ class AepButtonStyleTests { assertEquals(overridingStyle.border, result.border) assertEquals(overridingStyle.colors, result.colors) assertEquals(overridingStyle.contentPadding, result.contentPadding) - assertEquals(overridingStyle.buttonTextStyle?.textStyle, result.buttonTextStyle?.textStyle) - assertEquals(overridingStyle.buttonTextStyle?.overflow, result.buttonTextStyle?.overflow) - assertEquals(overridingStyle.buttonTextStyle?.softWrap, result.buttonTextStyle?.softWrap) - assertEquals(overridingStyle.buttonTextStyle?.maxLines, result.buttonTextStyle?.maxLines) - assertEquals(overridingStyle.buttonTextStyle?.minLines, result.buttonTextStyle?.minLines) - assertEquals(overridingStyle.buttonTextStyle?.modifier, result.buttonTextStyle?.modifier) + assertEquals(overridingStyle.textStyle?.textStyle, result.textStyle?.textStyle) + assertEquals(overridingStyle.textStyle?.overflow, result.textStyle?.overflow) + assertEquals(overridingStyle.textStyle?.softWrap, result.textStyle?.softWrap) + assertEquals(overridingStyle.textStyle?.maxLines, result.textStyle?.maxLines) + assertEquals(overridingStyle.textStyle?.minLines, result.textStyle?.minLines) + assertEquals(overridingStyle.textStyle?.modifier, result.textStyle?.modifier) } @Test @@ -77,7 +77,7 @@ class AepButtonStyleTests { border = mock(BorderStroke::class.java), colors = mock(ButtonColors::class.java), contentPadding = mock(PaddingValues::class.java), - buttonTextStyle = mock(AepTextStyle::class.java) + textStyle = mock(AepTextStyle::class.java) ) val overridingStyle = AepButtonStyle( modifier = Modifier.padding(16.dp).border(BorderStroke(2.dp, Color.Red)), @@ -87,7 +87,7 @@ class AepButtonStyleTests { border = BorderStroke(3.dp, Color.Green), colors = null, contentPadding = null, - buttonTextStyle = null + textStyle = null ) val result = AepButtonStyle.merge(defaultStyle, overridingStyle) @@ -99,7 +99,7 @@ class AepButtonStyleTests { assertEquals(overridingStyle.border, result.border) assertEquals(defaultStyle.colors, result.colors) assertEquals(defaultStyle.contentPadding, result.contentPadding) - assertEquals(defaultStyle.buttonTextStyle, result.buttonTextStyle) + assertEquals(defaultStyle.textStyle, result.textStyle) } @Test @@ -112,7 +112,7 @@ class AepButtonStyleTests { border = mock(BorderStroke::class.java), colors = mock(ButtonColors::class.java), contentPadding = mock(PaddingValues::class.java), - buttonTextStyle = mock(AepTextStyle::class.java) + textStyle = mock(AepTextStyle::class.java) ) val result = AepButtonStyle.merge(defaultStyle, null) @@ -123,7 +123,7 @@ class AepButtonStyleTests { assertEquals(defaultStyle.border, result.border) assertEquals(defaultStyle.colors, result.colors) assertEquals(defaultStyle.contentPadding, result.contentPadding) - assertEquals(defaultStyle.buttonTextStyle, result.buttonTextStyle) + assertEquals(defaultStyle.textStyle, result.textStyle) } @Test @@ -136,7 +136,7 @@ class AepButtonStyleTests { border = mock(BorderStroke::class.java), colors = mock(ButtonColors::class.java), contentPadding = mock(PaddingValues::class.java), - buttonTextStyle = mock(AepTextStyle::class.java) + textStyle = mock(AepTextStyle::class.java) ) val overridingStyle = AepButtonStyle( modifier = null, @@ -146,7 +146,7 @@ class AepButtonStyleTests { border = null, colors = null, contentPadding = null, - buttonTextStyle = null + textStyle = null ) val result = AepButtonStyle.merge(defaultStyle, overridingStyle) @@ -157,6 +157,6 @@ class AepButtonStyleTests { assertEquals(defaultStyle.border, result.border) assertEquals(defaultStyle.colors, result.colors) assertEquals(defaultStyle.contentPadding, result.contentPadding) - assertEquals(defaultStyle.buttonTextStyle, result.buttonTextStyle) + assertEquals(defaultStyle.textStyle, result.textStyle) } } diff --git a/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepStyleValidator.kt b/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepStyleValidator.kt index bb300a50..58078924 100644 --- a/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepStyleValidator.kt +++ b/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/AepStyleValidator.kt @@ -71,7 +71,7 @@ internal class AepStyleValidator { assertEquals(expectedStyle?.border, style?.border) assertEquals(expectedStyle?.colors, style?.colors) assertEquals(expectedStyle?.contentPadding, style?.contentPadding) - validateTextStyle(expectedStyle?.buttonTextStyle, style?.buttonTextStyle) + validateTextStyle(expectedStyle?.textStyle, style?.textStyle) } /** diff --git a/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/SmallImageUIStyleTests.kt b/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/SmallImageUIStyleTests.kt index 52573dbd..386e1a32 100644 --- a/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/SmallImageUIStyleTests.kt +++ b/code/messaging/src/test/java/com/adobe/marketing/mobile/aepcomposeui/style/SmallImageUIStyleTests.kt @@ -73,7 +73,7 @@ class SmallImageUIStyleTests { shape = CircleShape, border = BorderStroke(1.dp, Color.Red), contentPadding = null, - buttonTextStyle = AepTextStyle( + textStyle = AepTextStyle( modifier = Modifier.size(100.dp, 100.dp), textStyle = TextStyle(color = Color.Red, fontSize = 16.sp), overflow = TextOverflow.Clip, @@ -250,7 +250,7 @@ class SmallImageUIStyleTests { assertEquals(buttonStyles[index]?.elevation, builtButtonStyle.elevation) assertEquals(buttonStyles[index]?.enabled, builtButtonStyle.enabled) assertEquals(buttonStyles[index]?.modifier, builtButtonStyle.modifier) - AepStyleValidator.validateTextStyle(defaultSmallImageUIStyle.buttonStyle[index].buttonTextStyle, builtButtonStyle.buttonTextStyle) + AepStyleValidator.validateTextStyle(defaultSmallImageUIStyle.buttonStyle[index].textStyle, builtButtonStyle.textStyle) index++ } }