-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from tarkalabs/mohan/enhancement/button_block…
…_updation Leading and trailing icon added and minor changes in TableUICell component
- Loading branch information
Showing
20 changed files
with
107 additions
and
45 deletions.
There are no files selected for viewing
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
Binary file removed
BIN
-6.37 KB
...eenshots.TUIMobileButtonBlocksScreenShotTest__oneButtonOnly_darkTheme_false.png
Binary file not shown.
Binary file removed
BIN
-5.78 KB
...reenshots.TUIMobileButtonBlocksScreenShotTest__oneButtonOnly_darkTheme_true.png
Binary file not shown.
Binary file removed
BIN
-13 KB
...s.TUIMobileButtonBlocksScreenShotTest__twoButtonsWithWeight_darkTheme_false.png
Binary file not shown.
Binary file removed
BIN
-12.5 KB
...ts.TUIMobileButtonBlocksScreenShotTest__twoButtonsWithWeight_darkTheme_true.png
Binary file not shown.
Binary file removed
BIN
-13 KB
...screenshots.TUIMobileButtonBlocksScreenShotTest__twoButtons_darkTheme_false.png
Binary file not shown.
Binary file removed
BIN
-12.5 KB
....screenshots.TUIMobileButtonBlocksScreenShotTest__twoButtons_darkTheme_true.png
Binary file not shown.
Binary file added
BIN
+7.96 KB
...nBlocksScreenShotTest__oneButtonOnlyWithPrimaryLeadingIcon__darkTheme_false.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 added
BIN
+7.42 KB
...onBlocksScreenShotTest__oneButtonOnlyWithPrimaryLeadingIcon__darkTheme_true.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 added
BIN
+8.04 KB
...BlocksScreenShotTest__oneButtonOnlyWithPrimaryTrailingIcon__darkTheme_false.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 added
BIN
+7.42 KB
...nBlocksScreenShotTest__oneButtonOnlyWithPrimaryTrailingIcon__darkTheme_true.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 added
BIN
+7.45 KB
...MobileButtonBlocksScreenShotTest__oneButtonOnlyWithoutIcon__darkTheme_false.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 added
BIN
+7 KB
...IMobileButtonBlocksScreenShotTest__oneButtonOnlyWithoutIcon__darkTheme_true.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 added
BIN
+15.4 KB
....TUIMobileButtonBlocksScreenShotTest__twoButtonsWithWeight__darkTheme_false.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 added
BIN
+15.3 KB
...s.TUIMobileButtonBlocksScreenShotTest__twoButtonsWithWeight__darkTheme_true.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 added
BIN
+15.5 KB
...creenshots.TUIMobileButtonBlocksScreenShotTest__twoButtons__darkTheme_false.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 added
BIN
+15.4 KB
...screenshots.TUIMobileButtonBlocksScreenShotTest__twoButtons__darkTheme_true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 37 additions & 15 deletions
52
...idTest/java/com/tarkalabs/uicomponents/screenshots/TUIMobileButtonBlocksScreenShotTest.kt
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,58 +1,80 @@ | ||
@file:OptIn(ExperimentalMaterial3Api::class) | ||
|
||
package com.tarkalabs.uicomponents.screenshots | ||
|
||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import com.tarkalabs.tarkaicons.ChevronDown24 | ||
import com.tarkalabs.tarkaicons.ChevronUp24 | ||
import com.tarkalabs.tarkaicons.TarkaIcons | ||
import com.tarkalabs.uicomponents.components.TUIMobileButtonBlock | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.Parameterized | ||
|
||
|
||
@RunWith(Parameterized::class) | ||
class TUIMobileButtonBlocksScreenShotTest( | ||
private val testName: String, | ||
private val darkTheme: Boolean | ||
private val darkTheme: Boolean, | ||
) : ComposeScreenshotComparator() { | ||
|
||
companion object { | ||
@JvmStatic | ||
@Parameterized.Parameters | ||
fun data(): Collection<Array<Any>> { | ||
return mutableListOf<Array<Any>>().apply { | ||
fun data(): Collection<Array<Any?>> { | ||
return mutableListOf<Array<Any?>>().apply { | ||
for (darkTheme in listOf(true, false)) { | ||
val testName = "darkTheme_${darkTheme}" | ||
val testName = "_darkTheme_${darkTheme}" | ||
add(arrayOf(testName, darkTheme)) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Test fun oneButtonOnly() = compareScreenshotFor(darkTheme, "_oneButtonOnly_$testName") { | ||
@Test fun oneButtonOnlyWithoutIcon() = compareScreenshotFor(darkTheme, "_oneButtonOnlyWithoutIcon_$testName") { | ||
TUIMobileButtonBlock( | ||
primaryButtonLabel = "Label", | ||
primaryButtonOnClick = { /*TODO*/ }, | ||
outlineButtonLabel = null, | ||
outlineButtonOnClick = null | ||
outlineButtonOnClick = null, | ||
) | ||
} | ||
|
||
@Test fun twoButtons() = compareScreenshotFor(darkTheme, "_twoButtons_$testName") { | ||
@Test fun oneButtonOnlyWithPrimaryLeadingIcon() = compareScreenshotFor(darkTheme, "_oneButtonOnlyWithPrimaryLeadingIcon_$testName") { | ||
TUIMobileButtonBlock( | ||
primaryButtonLabel = "Label", | ||
primaryButtonOnClick = { /*TODO*/ }, | ||
outlineButtonLabel = "Label", | ||
outlineButtonOnClick = { /*TODO*/ } | ||
outlineButtonLabel = null, | ||
outlineButtonOnClick = null, | ||
primaryLeadingIcon = TarkaIcons.Regular.ChevronDown24, | ||
primaryTrailingIcon = null | ||
) | ||
} | ||
|
||
@Test fun twoButtonsWithWeight() = compareScreenshotFor(darkTheme, "_twoButtonsWithWeight_$testName") { | ||
@Test fun oneButtonOnlyWithPrimaryTrailingIcon() = compareScreenshotFor(darkTheme, "_oneButtonOnlyWithPrimaryTrailingIcon_$testName") { | ||
TUIMobileButtonBlock( | ||
primaryButtonLabel = "Label", | ||
primaryButtonOnClick = { /*TODO*/ }, | ||
outlineButtonLabel = null, | ||
outlineButtonOnClick = null, | ||
primaryLeadingIcon = null, | ||
primaryTrailingIcon = TarkaIcons.Regular.ChevronUp24 | ||
) | ||
} | ||
|
||
@Test fun twoButtons() = compareScreenshotFor(darkTheme, "_twoButtons_$testName") { | ||
TUIMobileButtonBlock( | ||
primaryButtonLabel = "Label", | ||
primaryButtonOnClick = { /*TODO*/ }, | ||
outlineButtonLabel = "Label", | ||
outlineButtonOnClick = { /*TODO*/ }, | ||
primaryButtonWeight = 3f | ||
) | ||
} | ||
|
||
@Test fun twoButtonsWithWeight() = | ||
compareScreenshotFor(darkTheme, "_twoButtonsWithWeight_$testName") { | ||
TUIMobileButtonBlock( | ||
primaryButtonLabel = "Label", | ||
primaryButtonOnClick = { /*TODO*/ }, | ||
outlineButtonLabel = "Label", | ||
outlineButtonOnClick = { /*TODO*/ }, | ||
primaryButtonWeight = 3f, | ||
) | ||
} | ||
} |
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