diff --git a/core/src/test/java/com/orange/ouds/core/component/OudsComponentTest.kt b/core/src/test/java/com/orange/ouds/core/component/OudsComponentTest.kt new file mode 100644 index 00000000..bd31ec03 --- /dev/null +++ b/core/src/test/java/com/orange/ouds/core/component/OudsComponentTest.kt @@ -0,0 +1,26 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.core.component + +import app.cash.paparazzi.Paparazzi +import com.android.ide.common.rendering.api.SessionParams +import org.junit.Rule +import org.junit.runner.RunWith +import org.junit.runners.Parameterized + +@RunWith(Parameterized::class) +internal abstract class OudsComponentTest { + + @get:Rule + val paparazzi = Paparazzi(renderingMode = SessionParams.RenderingMode.SHRINK, maxPercentDifference = 0.01) +} \ No newline at end of file diff --git a/core/src/test/java/com/orange/ouds/core/component/button/OudsButtonTest.kt b/core/src/test/java/com/orange/ouds/core/component/button/OudsButtonTest.kt index bfd7743e..5a818865 100644 --- a/core/src/test/java/com/orange/ouds/core/component/button/OudsButtonTest.kt +++ b/core/src/test/java/com/orange/ouds/core/component/button/OudsButtonTest.kt @@ -12,15 +12,11 @@ package com.orange.ouds.core.component.button -import app.cash.paparazzi.Paparazzi -import com.android.ide.common.rendering.api.SessionParams -import org.junit.Rule +import com.orange.ouds.core.component.OudsComponentTest import org.junit.Test -import org.junit.runner.RunWith import org.junit.runners.Parameterized -@RunWith(Parameterized::class) -internal class OudsButtonTest(private val parameter: OudsButtonPreviewParameter) { +internal class OudsButtonTest(private val parameter: OudsButtonPreviewParameter) : OudsComponentTest() { companion object { @JvmStatic @@ -28,9 +24,6 @@ internal class OudsButtonTest(private val parameter: OudsButtonPreviewParameter) internal fun data() = OudsButtonPreviewParameterProvider().values.toList() } - @get:Rule - val paparazzi = Paparazzi(renderingMode = SessionParams.RenderingMode.SHRINK, maxPercentDifference = 0.01) - @Test fun takeOudsButtonLightThemeSnapshot() { paparazzi.snapshot { diff --git a/core/src/test/java/com/orange/ouds/core/component/link/OudsLinkTest.kt b/core/src/test/java/com/orange/ouds/core/component/link/OudsLinkTest.kt new file mode 100644 index 00000000..bd14e014 --- /dev/null +++ b/core/src/test/java/com/orange/ouds/core/component/link/OudsLinkTest.kt @@ -0,0 +1,46 @@ +/* + * Software Name: OUDS Android + * SPDX-FileCopyrightText: Copyright (c) Orange SA + * SPDX-License-Identifier: MIT + * + * This software is distributed under the MIT license, + * the text of which is available at https://opensource.org/license/MIT/ + * or see the "LICENSE" file for more details. + * + * Software description: Android library of reusable graphical components + */ + +package com.orange.ouds.core.component.link + +import com.orange.ouds.core.component.OudsComponentTest +import org.junit.Test +import org.junit.runners.Parameterized + +internal class OudsLinkTest(private val parameter: OudsLinkPreviewParameter) : OudsComponentTest() { + + companion object { + @JvmStatic + @Parameterized.Parameters + internal fun data() = OudsLinkPreviewParameterProvider().values.toList() + } + + @Test + fun takeOudsLinkLightThemeSnapshot() { + paparazzi.snapshot { + PreviewOudsLink( + darkThemeEnabled = false, + parameter = parameter + ) + } + } + + @Test + fun takeOudsLinkDarkThemeSnapshot() { + paparazzi.snapshot { + PreviewOudsLink( + darkThemeEnabled = true, + parameter = parameter + ) + } + } +} \ No newline at end of file diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[0].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[0].png new file mode 100644 index 00000000..bdf39836 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[0].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[10].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[10].png new file mode 100644 index 00000000..0ccda345 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[10].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[11].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[11].png new file mode 100644 index 00000000..ff55f704 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[11].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[12].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[12].png new file mode 100644 index 00000000..a426a989 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[12].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[13].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[13].png new file mode 100644 index 00000000..cb756500 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[13].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[14].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[14].png new file mode 100644 index 00000000..68568b87 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[14].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[15].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[15].png new file mode 100644 index 00000000..452cfce7 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[15].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[1].png new file mode 100644 index 00000000..4c39101c Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[1].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[2].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[2].png new file mode 100644 index 00000000..db703872 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[2].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[3].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[3].png new file mode 100644 index 00000000..75034fd0 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[3].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[4].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[4].png new file mode 100644 index 00000000..57c29467 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[4].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[5].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[5].png new file mode 100644 index 00000000..d2376a1b Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[5].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[6].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[6].png new file mode 100644 index 00000000..aa4d28b3 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[6].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[7].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[7].png new file mode 100644 index 00000000..686e0d3b Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[7].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[8].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[8].png new file mode 100644 index 00000000..073475ee Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[8].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[9].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[9].png new file mode 100644 index 00000000..bfa988a4 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkDarkThemeSnapshot[9].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[0].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[0].png new file mode 100644 index 00000000..dca59916 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[0].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[10].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[10].png new file mode 100644 index 00000000..41f813fe Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[10].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[11].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[11].png new file mode 100644 index 00000000..4928b9bf Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[11].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[12].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[12].png new file mode 100644 index 00000000..27544e60 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[12].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[13].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[13].png new file mode 100644 index 00000000..8d47f1cd Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[13].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[14].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[14].png new file mode 100644 index 00000000..bdaad2d7 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[14].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[15].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[15].png new file mode 100644 index 00000000..cfe1dc06 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[15].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[1].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[1].png new file mode 100644 index 00000000..cb9b037e Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[1].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[2].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[2].png new file mode 100644 index 00000000..a6400af4 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[2].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[3].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[3].png new file mode 100644 index 00000000..5b514a24 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[3].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[4].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[4].png new file mode 100644 index 00000000..2221ba1e Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[4].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[5].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[5].png new file mode 100644 index 00000000..69ca4fd1 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[5].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[6].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[6].png new file mode 100644 index 00000000..2e699067 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[6].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[7].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[7].png new file mode 100644 index 00000000..d3196cf8 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[7].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[8].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[8].png new file mode 100644 index 00000000..a5fb45c6 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[8].png differ diff --git a/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[9].png b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[9].png new file mode 100644 index 00000000..eef9e528 Binary files /dev/null and b/core/src/test/snapshots/images/com.orange.ouds.core.component.link_OudsLinkTest_takeOudsLinkLightThemeSnapshot[9].png differ