-
Notifications
You must be signed in to change notification settings - Fork 662
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix LinkButton shape * Remove surface wrapping in DefaultLinkTheme * Test rounded corner background is correctly tinted * Update paymentsheet/src/test/java/com/stripe/android/link/ui/LinkButtonScreenshotTest.kt Co-authored-by: Jay Newstrom <[email protected]> * Restore missing tests * Update screenshot test ground truth --------- Co-authored-by: Jay Newstrom <[email protected]>
- Loading branch information
1 parent
e4d987b
commit 2095d93
Showing
47 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
Binary file modified
BIN
+156 Bytes
(100%)
...reenshot.TestPaymentSheetScreenshots_testPaymentSheetAlongsideSfuLinkSignUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+229 Bytes
(100%)
...reenshot.TestPaymentSheetScreenshots_testPaymentSheetInsteadOfSfuLinkSignUp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,43 @@ | ||
package com.stripe.android.link.ui | ||
|
||
import android.graphics.Color | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.stripe.android.paymentsheet.PaymentSheet | ||
import com.stripe.android.paymentsheet.parseAppearance | ||
import com.stripe.android.screenshottesting.FontSize | ||
import com.stripe.android.screenshottesting.Locale | ||
import com.stripe.android.screenshottesting.PaparazziConfigOption | ||
import com.stripe.android.screenshottesting.PaparazziRule | ||
import com.stripe.android.screenshottesting.SystemAppearance | ||
import com.stripe.android.utils.screenshots.PaymentSheetAppearance.DefaultAppearance | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
private enum class LinkButtonAppearance(private val appearance: PaymentSheet.Appearance) : PaparazziConfigOption { | ||
|
||
TestSurfaceBackgroundAppearance( | ||
appearance = PaymentSheet.Appearance( | ||
colorsLight = PaymentSheet.Colors.defaultLight.copy( | ||
surface = Color.RED, | ||
), | ||
colorsDark = PaymentSheet.Colors.defaultDark.copy( | ||
surface = Color.RED, | ||
), | ||
), | ||
); | ||
|
||
override fun initialize() { | ||
appearance.parseAppearance() | ||
} | ||
|
||
override fun reset() { | ||
DefaultAppearance.appearance.parseAppearance() | ||
} | ||
} | ||
|
||
internal class LinkButtonScreenshotTest { | ||
@get:Rule | ||
val paparazziRule = PaparazziRule( | ||
|
@@ -31,6 +58,16 @@ internal class LinkButtonScreenshotTest { | |
.fillMaxWidth(), | ||
) | ||
|
||
@get:Rule | ||
val surfacePaparazziRule = PaparazziRule( | ||
SystemAppearance.entries, | ||
LinkButtonAppearance.entries, | ||
FontSize.entries, | ||
boxModifier = Modifier | ||
.padding(0.dp) | ||
.fillMaxWidth(), | ||
) | ||
|
||
@Test | ||
fun testNewUser() { | ||
paparazziRule.snapshot { | ||
|
@@ -79,4 +116,11 @@ internal class LinkButtonScreenshotTest { | |
LinkButton(email = "[email protected]", enabled = false, onClick = { }) | ||
} | ||
} | ||
|
||
@Test | ||
fun testRoundedCornerSurfaceColor() { | ||
surfacePaparazziRule.snapshot { | ||
LinkButton(email = null, enabled = true, onClick = { }) | ||
} | ||
} | ||
} |
Binary file modified
BIN
+6 Bytes
(100%)
...ui_LinkButtonScreenshotTest_testExistingUserDisabled[DarkTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+28 Bytes
(100%)
...k.ui_LinkButtonScreenshotTest_testExistingUserDisabled[DarkTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+37 Bytes
(100%)
...i_LinkButtonScreenshotTest_testExistingUserDisabled[LightTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+32 Bytes
(100%)
....ui_LinkButtonScreenshotTest_testExistingUserDisabled[LightTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...ScreenshotTest_testExistingUserWithLongEmailDisabled[DarkTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+27 Bytes
(100%)
...onScreenshotTest_testExistingUserWithLongEmailDisabled[DarkTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38 Bytes
(100%)
...creenshotTest_testExistingUserWithLongEmailDisabled[LightTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+30 Bytes
(100%)
...nScreenshotTest_testExistingUserWithLongEmailDisabled[LightTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+16 Bytes
(100%)
...nkButtonScreenshotTest_testExistingUserWithLongEmail[DarkTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+24 Bytes
(100%)
...LinkButtonScreenshotTest_testExistingUserWithLongEmail[DarkTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+42 Bytes
(100%)
...kButtonScreenshotTest_testExistingUserWithLongEmail[LightTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+29 Bytes
(100%)
...inkButtonScreenshotTest_testExistingUserWithLongEmail[LightTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11 Bytes
(100%)
...id.link.ui_LinkButtonScreenshotTest_testExistingUser[DarkTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+32 Bytes
(100%)
...roid.link.ui_LinkButtonScreenshotTest_testExistingUser[DarkTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+36 Bytes
(100%)
...d.link.ui_LinkButtonScreenshotTest_testExistingUser[LightTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+35 Bytes
(100%)
...oid.link.ui_LinkButtonScreenshotTest_testExistingUser[LightTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7 Bytes
(100%)
...link.ui_LinkButtonScreenshotTest_testNewUserDisabled[DarkTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+23 Bytes
(100%)
...d.link.ui_LinkButtonScreenshotTest_testNewUserDisabled[DarkTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+39 Bytes
(100%)
...ink.ui_LinkButtonScreenshotTest_testNewUserDisabled[LightTheme,DefaultFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+27 Bytes
(100%)
....link.ui_LinkButtonScreenshotTest_testNewUserDisabled[LightTheme,LargeFont].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
...ScreenshotTest_testNewUserInDifferentLocales[DarkTheme,DefaultFont,Finland].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
...nScreenshotTest_testNewUserInDifferentLocales[DarkTheme,DefaultFont,France].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
...nshotTest_testNewUserInDifferentLocales[DarkTheme,DefaultFont,UnitedStates].png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+26 Bytes
(100%)
...onScreenshotTest_testNewUserInDifferentLocales[DarkTheme,LargeFont,Finland].png
Oops, something went wrong.
Binary file modified
BIN
+26 Bytes
(100%)
...tonScreenshotTest_testNewUserInDifferentLocales[DarkTheme,LargeFont,France].png
Oops, something went wrong.
Binary file modified
BIN
+26 Bytes
(100%)
...eenshotTest_testNewUserInDifferentLocales[DarkTheme,LargeFont,UnitedStates].png
Oops, something went wrong.
Binary file modified
BIN
+33 Bytes
(100%)
...creenshotTest_testNewUserInDifferentLocales[LightTheme,DefaultFont,Finland].png
Oops, something went wrong.
Binary file modified
BIN
+33 Bytes
(100%)
...ScreenshotTest_testNewUserInDifferentLocales[LightTheme,DefaultFont,France].png
Oops, something went wrong.
Binary file modified
BIN
+33 Bytes
(100%)
...shotTest_testNewUserInDifferentLocales[LightTheme,DefaultFont,UnitedStates].png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
...nScreenshotTest_testNewUserInDifferentLocales[LightTheme,LargeFont,Finland].png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
...onScreenshotTest_testNewUserInDifferentLocales[LightTheme,LargeFont,France].png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
...enshotTest_testNewUserInDifferentLocales[LightTheme,LargeFont,UnitedStates].png
Oops, something went wrong.
Binary file modified
BIN
+14 Bytes
(100%)
...android.link.ui_LinkButtonScreenshotTest_testNewUser[DarkTheme,DefaultFont].png
Oops, something went wrong.
Binary file modified
BIN
+26 Bytes
(100%)
...e.android.link.ui_LinkButtonScreenshotTest_testNewUser[DarkTheme,LargeFont].png
Oops, something went wrong.
Binary file modified
BIN
+33 Bytes
(100%)
...ndroid.link.ui_LinkButtonScreenshotTest_testNewUser[LightTheme,DefaultFont].png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
....android.link.ui_LinkButtonScreenshotTest_testNewUser[LightTheme,LargeFont].png
Oops, something went wrong.
Binary file added
BIN
+8.97 KB
...edCornerSurfaceColor[DarkTheme,TestSurfaceBackgroundAppearance,DefaultFont].png
Oops, something went wrong.
Binary file added
BIN
+11.3 KB
...ndedCornerSurfaceColor[DarkTheme,TestSurfaceBackgroundAppearance,LargeFont].png
Oops, something went wrong.
Binary file added
BIN
+8.97 KB
...dCornerSurfaceColor[LightTheme,TestSurfaceBackgroundAppearance,DefaultFont].png
Oops, something went wrong.
Binary file added
BIN
+11.3 KB
...dedCornerSurfaceColor[LightTheme,TestSurfaceBackgroundAppearance,LargeFont].png
Oops, something went wrong.
Binary file modified
BIN
+3.6 KB
(110%)
...entSheetScreenVerticalModeScreenshotTest_displaysVerticalModeListWithLink[].png
Oops, something went wrong.