Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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,
),
)
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
Loading