-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/test_rating
- Loading branch information
Showing
163 changed files
with
1,442 additions
and
11 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
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
49 changes: 49 additions & 0 deletions
49
badges/src/test/kotlin/com/decathlon/vitamin/badges/VitaminBadgesPrimaryTest.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.decathlon.vitamin.badges | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.Scaffold | ||
import androidx.compose.material.Text | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import app.cash.paparazzi.Paparazzi | ||
import com.decathlon.vitamin.badges.utils.BadgesVariantsFactory | ||
import com.decathlon.vitamin.badges.utils.Theme | ||
import com.decathlon.vitamin.badges.utils.Variant | ||
import com.decathlon.vitamin.compose.foundation.VitaminTheme | ||
import com.google.testing.junit.testparameterinjector.TestParameter | ||
import com.google.testing.junit.testparameterinjector.TestParameterInjector | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
|
||
@RunWith(TestParameterInjector::class) | ||
class VitaminBadgesPrimaryTest( | ||
@TestParameter val variant: Variant | ||
) { | ||
|
||
@get:Rule | ||
val paparazzi = Paparazzi() | ||
|
||
@Test | ||
fun medium(@TestParameter theme: Theme) { | ||
paparazzi.snapshot { | ||
VitaminTheme(theme == Theme.Dark) { | ||
Scaffold { padding -> | ||
Column( | ||
modifier = Modifier.padding(padding), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text(text = variant.name, style = VitaminTheme.typography.subtitle1) | ||
BadgesVariantsFactory.Badges( | ||
variant = variant | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
147 changes: 147 additions & 0 deletions
147
badges/src/test/kotlin/com/decathlon/vitamin/badges/VitaminCountBadgesPrimaryTest.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 |
---|---|---|
@@ -0,0 +1,147 @@ | ||
package com.decathlon.vitamin.badges | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.Scaffold | ||
import androidx.compose.material.Text | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import app.cash.paparazzi.Paparazzi | ||
import com.decathlon.vitamin.badges.utils.BadgesVariantsFactory | ||
import com.decathlon.vitamin.badges.utils.Theme | ||
import com.decathlon.vitamin.badges.utils.Variant | ||
import com.decathlon.vitamin.compose.badges.VitaminBadgeSizes | ||
import com.decathlon.vitamin.compose.foundation.VitaminTheme | ||
import com.google.testing.junit.testparameterinjector.TestParameter | ||
import com.google.testing.junit.testparameterinjector.TestParameterInjector | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
|
||
@RunWith(TestParameterInjector::class) | ||
class VitaminCountBadgesPrimaryTest( | ||
@TestParameter val variant: Variant | ||
) { | ||
|
||
@get:Rule | ||
val paparazzi = Paparazzi() | ||
|
||
@Test | ||
fun small(@TestParameter theme: Theme) { | ||
paparazzi.snapshot { | ||
VitaminTheme(theme == Theme.Dark) { | ||
Scaffold { padding -> | ||
Column( | ||
modifier = Modifier.padding(padding), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text(text = variant.name, style = VitaminTheme.typography.subtitle1) | ||
Row (horizontalArrangement = Arrangement.spacedBy(16.dp)) { | ||
BadgesVariantsFactory.CountBadges( | ||
count = 120, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 50, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 1, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 0, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
@Test | ||
fun medium(@TestParameter theme: Theme) { | ||
paparazzi.snapshot { | ||
VitaminTheme(theme == Theme.Dark) { | ||
Scaffold { padding -> | ||
Column( | ||
modifier = Modifier.padding(padding), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text(text = variant.name, style = VitaminTheme.typography.subtitle1) | ||
Row (horizontalArrangement = Arrangement.spacedBy(16.dp)) { | ||
BadgesVariantsFactory.CountBadges( | ||
count = 120, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 50, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 1, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 0, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun large(@TestParameter theme: Theme) { | ||
paparazzi.snapshot { | ||
VitaminTheme(theme == Theme.Dark) { | ||
Scaffold { padding -> | ||
Column( | ||
modifier = Modifier.padding(padding), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text(text = variant.name, style = VitaminTheme.typography.subtitle1) | ||
Row (horizontalArrangement = Arrangement.spacedBy(16.dp)) { | ||
BadgesVariantsFactory.CountBadges( | ||
count = 120, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 50, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 1, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
BadgesVariantsFactory.CountBadges( | ||
count = 0, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
147 changes: 147 additions & 0 deletions
147
badges/src/test/kotlin/com/decathlon/vitamin/badges/VitaminStandaloneBadgesPrimaryTest.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 |
---|---|---|
@@ -0,0 +1,147 @@ | ||
package com.decathlon.vitamin.badges | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material.Scaffold | ||
import androidx.compose.material.Text | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import app.cash.paparazzi.Paparazzi | ||
import com.decathlon.vitamin.badges.utils.BadgesVariantsFactory | ||
import com.decathlon.vitamin.badges.utils.Theme | ||
import com.decathlon.vitamin.badges.utils.Variant | ||
import com.decathlon.vitamin.compose.badges.VitaminBadgeSizes | ||
import com.decathlon.vitamin.compose.foundation.VitaminTheme | ||
import com.google.testing.junit.testparameterinjector.TestParameter | ||
import com.google.testing.junit.testparameterinjector.TestParameterInjector | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
|
||
@RunWith(TestParameterInjector::class) | ||
class VitaminStandaloneBadgesPrimaryTest( | ||
@TestParameter val variant: Variant | ||
) { | ||
|
||
@get:Rule | ||
val paparazzi = Paparazzi() | ||
|
||
@Test | ||
fun small(@TestParameter theme: Theme) { | ||
paparazzi.snapshot { | ||
VitaminTheme(theme == Theme.Dark) { | ||
Scaffold { padding -> | ||
Column( | ||
modifier = Modifier.padding(padding), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text(text = variant.name, style = VitaminTheme.typography.subtitle1) | ||
Row (horizontalArrangement = Arrangement.spacedBy(16.dp)) { | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 120, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 50, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 1, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 0, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.small() | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
@Test | ||
fun medium(@TestParameter theme: Theme) { | ||
paparazzi.snapshot { | ||
VitaminTheme(theme == Theme.Dark) { | ||
Scaffold { padding -> | ||
Column( | ||
modifier = Modifier.padding(padding), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text(text = variant.name, style = VitaminTheme.typography.subtitle1) | ||
Row (horizontalArrangement = Arrangement.spacedBy(16.dp)) { | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 120, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 50, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 1, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 0, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.medium() | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun large(@TestParameter theme: Theme) { | ||
paparazzi.snapshot { | ||
VitaminTheme(theme == Theme.Dark) { | ||
Scaffold { padding -> | ||
Column( | ||
modifier = Modifier.padding(padding), | ||
verticalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
Text(text = variant.name, style = VitaminTheme.typography.subtitle1) | ||
Row (horizontalArrangement = Arrangement.spacedBy(16.dp)) { | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 120, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 50, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 1, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
BadgesVariantsFactory.StandaloneBadges( | ||
count = 0, | ||
variant = variant, | ||
sizes = VitaminBadgeSizes.large() | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.