diff --git a/sdds-core/testing/src/main/kotlin/com/sdds/testing/vs/file/FileTestCases.kt b/sdds-core/testing/src/main/kotlin/com/sdds/testing/vs/file/FileTestCases.kt new file mode 100644 index 000000000..9fc7aa461 --- /dev/null +++ b/sdds-core/testing/src/main/kotlin/com/sdds/testing/vs/file/FileTestCases.kt @@ -0,0 +1,114 @@ +package com.sdds.testing.vs.file + +import com.sdds.testing.vs.ComponentScope +import com.sdds.testing.vs.RoborazziConfig +import com.sdds.uikit.File + +/** + * Тест-кейсы для [File] + */ +@Suppress("UndocumentedPublicFunction") +abstract class FileTestCases(mode: String) : RoborazziConfig(mode) { + + /** + * PLASMA-T2444 + */ + abstract fun testFileCircularProgressLDefaultIsLoadingStart() + + /** + * PLASMA-T2445 + */ + abstract fun testFileLinearProgressMNegativeIsLoadingHasContentEnd() + + /** + * PLASMA-T2446 + */ + abstract fun testFileCircularProgressSDefaultHasContentDescriptionEnd() + + /** + * PLASMA-T2447 + */ + abstract fun testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart() + + /** + * PLASMA-T2448 + */ + abstract fun testFileCircularProgressLNegativeIsLoadingLongText() + + /** + * PLASMA-T2449 + */ + abstract fun testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd() + + fun ComponentScope.fileLabelDescriptionIsLoadingStart(style: Int): File = + file( + context = context, + style = style, + state = FileUiState( + label = "image.jpg", + description = "1.2MB", + isLoading = true, + hasContentStart = false, + actionPlacement = ActionPlacement.Start, + contentType = FileContentType.Icon, + ), + ) + + fun ComponentScope.fileIsLoadingHasContentEnd(style: Int): File = + file( + context = context, + style = style, + state = FileUiState( + label = "image.jpg", + description = "1.2MB", + isLoading = true, + hasContentStart = true, + actionPlacement = ActionPlacement.End, + contentType = FileContentType.Icon, + ), + ) + + fun ComponentScope.fileHasContentNoLabelEnd(style: Int): File = + file( + context = context, + style = style, + state = FileUiState( + label = "", + description = "1.2MB", + isLoading = false, + hasContentStart = true, + actionPlacement = ActionPlacement.End, + contentType = FileContentType.Icon, + ), + ) + + fun ComponentScope.fileLongText(style: Int): File = + file( + context = context, + style = style, + state = FileUiState( + appearance = "", + label = "Lorem Ipsum is simply dummy text of the printing and typesetting", + description = "Lorem Ipsum is simply dummy text of the printing and typesetting", + isLoading = true, + hasContentStart = false, + actionPlacement = ActionPlacement.End, + contentType = FileContentType.Icon, + ), + ) + + fun ComponentScope.fileIsLoadingHasContentNoDescriptionEnd(style: Int): File = + file( + context = context, + style = style, + state = FileUiState( + appearance = "", + label = "image.jpg", + description = "", + isLoading = true, + hasContentStart = true, + actionPlacement = ActionPlacement.End, + contentType = FileContentType.Icon, + ), + ) +} diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd_dark.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd_dark.png new file mode 100644 index 000000000..56ce679ce Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd_dark.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd_light.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd_light.png new file mode 100644 index 000000000..1f47d184e Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd_light.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingStart_dark.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingStart_dark.png new file mode 100644 index 000000000..2f0a8e6c6 Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingStart_dark.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingStart_light.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingStart_light.png new file mode 100644 index 000000000..0bb73880a Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLDefaultIsLoadingStart_light.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressLNegativeIsLoadingLongText_dark.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLNegativeIsLoadingLongText_dark.png new file mode 100644 index 000000000..45a63d485 Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLNegativeIsLoadingLongText_dark.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressLNegativeIsLoadingLongText_light.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLNegativeIsLoadingLongText_light.png new file mode 100644 index 000000000..1e49c651c Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressLNegativeIsLoadingLongText_light.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressSDefaultHasContentDescriptionEnd_dark.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressSDefaultHasContentDescriptionEnd_dark.png new file mode 100644 index 000000000..6cc5031ae Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressSDefaultHasContentDescriptionEnd_dark.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileCircularProgressSDefaultHasContentDescriptionEnd_light.png b/tokens/sdds.serv.view/screenshots/testFileCircularProgressSDefaultHasContentDescriptionEnd_light.png new file mode 100644 index 000000000..e03f31e4f Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileCircularProgressSDefaultHasContentDescriptionEnd_light.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileLinearProgressMNegativeIsLoadingHasContentEnd_dark.png b/tokens/sdds.serv.view/screenshots/testFileLinearProgressMNegativeIsLoadingHasContentEnd_dark.png new file mode 100644 index 000000000..9aafdabf6 Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileLinearProgressMNegativeIsLoadingHasContentEnd_dark.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileLinearProgressMNegativeIsLoadingHasContentEnd_light.png b/tokens/sdds.serv.view/screenshots/testFileLinearProgressMNegativeIsLoadingHasContentEnd_light.png new file mode 100644 index 000000000..7cbbf352f Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileLinearProgressMNegativeIsLoadingHasContentEnd_light.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart_dark.png b/tokens/sdds.serv.view/screenshots/testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart_dark.png new file mode 100644 index 000000000..e9dea0d84 Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart_dark.png differ diff --git a/tokens/sdds.serv.view/screenshots/testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart_light.png b/tokens/sdds.serv.view/screenshots/testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart_light.png new file mode 100644 index 000000000..3287b1167 Binary files /dev/null and b/tokens/sdds.serv.view/screenshots/testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart_light.png differ diff --git a/tokens/sdds.serv.view/src/test/kotlin/com/sdds/serv/ViewSystemFileScreenshotTest.kt b/tokens/sdds.serv.view/src/test/kotlin/com/sdds/serv/ViewSystemFileScreenshotTest.kt new file mode 100644 index 000000000..099a6678b --- /dev/null +++ b/tokens/sdds.serv.view/src/test/kotlin/com/sdds/serv/ViewSystemFileScreenshotTest.kt @@ -0,0 +1,60 @@ +package com.sdds.serv + +import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers +import com.sdds.testing.vs.SDK_NUMBER +import com.sdds.testing.vs.file.FileTestCases +import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.ParameterizedRobolectricTestRunner +import org.robolectric.annotation.Config +import org.robolectric.annotation.GraphicsMode + +@RunWith(ParameterizedRobolectricTestRunner::class) +@GraphicsMode(GraphicsMode.Mode.NATIVE) +@Config(sdk = [SDK_NUMBER], qualifiers = RobolectricDeviceQualifiers.Pixel6) +class ViewSystemFileScreenshotTest( + theme: String, +) : FileTestCases(theme) { + + @Test + override fun testFileCircularProgressLDefaultIsLoadingStart() { + themedComponent { + fileLabelDescriptionIsLoadingStart(R.style.Serv_Sdds_ComponentOverlays_FileCircularProgressLDefault) + } + } + + @Test + override fun testFileLinearProgressMNegativeIsLoadingHasContentEnd() { + themedComponent { + fileIsLoadingHasContentEnd(R.style.Serv_Sdds_ComponentOverlays_FileLinearProgressMNegative) + } + } + + @Test + override fun testFileCircularProgressSDefaultHasContentDescriptionEnd() { + themedComponent { + fileHasContentNoLabelEnd(R.style.Serv_Sdds_ComponentOverlays_FileCircularProgressSDefault) + } + } + + @Test + override fun testFileLinearProgressXsNegativeIsLoadingLabelDescriptionStart() { + themedComponent { + fileLabelDescriptionIsLoadingStart(R.style.Serv_Sdds_ComponentOverlays_FileLinearProgressXsNegative) + } + } + + @Test + override fun testFileCircularProgressLNegativeIsLoadingLongText() { + themedComponent { + fileLongText(R.style.Serv_Sdds_ComponentOverlays_FileCircularProgressLNegative) + } + } + + @Test + override fun testFileCircularProgressLDefaultIsLoadingHasContentNoDescriptionEnd() { + themedComponent { + fileIsLoadingHasContentNoDescriptionEnd(R.style.Serv_Sdds_ComponentOverlays_FileCircularProgressLDefault) + } + } +}