Skip to content

Commit

Permalink
feat: [ANDROAPP-5676] correct snapshot tests and update paparazzi to …
Browse files Browse the repository at this point in the history
…latest version
  • Loading branch information
xavimolloy committed Apr 8, 2024
1 parent 6a2029e commit 387f11d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id("org.jetbrains.compose")
id("com.android.library")
id("convention.publication")
id("app.cash.paparazzi").version("1.3.2")
id("app.cash.paparazzi").version("1.3.3")
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package org.hisp.dhis.mobile.ui.designsystem

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.FileDownload
import androidx.compose.material3.Icon
import androidx.compose.ui.Modifier
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.ExtendedFAB
import org.hisp.dhis.mobile.ui.designsystem.component.FAB
import org.hisp.dhis.mobile.ui.designsystem.component.FABStyle
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.junit.Rule
import org.junit.Test

Expand All @@ -18,7 +21,7 @@ class FABSnapshotTest {
@Test
fun launchFAB() {
paparazzi.snapshot {
ColumnComponentContainer {
ColumnComponentContainer(modifier = Modifier.padding(Spacing.Spacing10)) {
FAB(
style = FABStyle.SURFACE,
onClick = {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.hisp.dhis.mobile.ui.designsystem

import androidx.compose.foundation.layout.padding
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.TextFieldValue
import org.hisp.dhis.mobile.ui.designsystem.component.AgeInputType
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
Expand All @@ -8,6 +10,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.InputAgeModel
import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState
import org.hisp.dhis.mobile.ui.designsystem.component.SubTitle
import org.hisp.dhis.mobile.ui.designsystem.component.TimeUnitValues
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.junit.Rule
import org.junit.Test

Expand All @@ -19,7 +22,7 @@ class InputAgeSnapshotTest {
@Test
fun launchInputAgeSnapshot() {
paparazzi.snapshot {
ColumnComponentContainer {
ColumnComponentContainer(modifier = Modifier.padding(Spacing.Spacing10)) {
SubTitle("Input Age Component - Idle")
InputAge(
InputAgeModel(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.hisp.dhis.mobile.ui.designsystem

import androidx.compose.foundation.layout.padding
import androidx.compose.ui.Modifier
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.InputChip
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.junit.Rule
import org.junit.Test

Expand All @@ -13,7 +16,7 @@ class InputChipSnapshotTest {
@Test
fun launchChip() {
paparazzi.snapshot {
ColumnComponentContainer {
ColumnComponentContainer(modifier = Modifier.padding(Spacing.Spacing10)) {
InputChip(label = "Label", selected = false, badge = "3")
InputChip(label = "Label", selected = true, badge = "3")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package org.hisp.dhis.mobile.ui.designsystem

import androidx.compose.foundation.layout.padding
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.Indicator
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.junit.Rule
import org.junit.Test

Expand All @@ -14,7 +17,7 @@ class InputIndicatorSnapshotTest {
@Test
fun launchIndicatorInput() {
paparazzi.snapshot {
ColumnComponentContainer {
ColumnComponentContainer(modifier = Modifier.padding(Spacing.Spacing10)) {
Indicator(
title = "Heart Rate",
content = "160 bpm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package org.hisp.dhis.mobile.ui.designsystem

import android.graphics.Bitmap
import android.graphics.BitmapFactory
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.painter.BitmapPainter
Expand All @@ -12,6 +14,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.InputMatrix
import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState
import org.hisp.dhis.mobile.ui.designsystem.component.internal.ImageCardData
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor
import org.junit.Rule
import org.junit.Test
Expand Down Expand Up @@ -79,7 +82,7 @@ class InputMatrixSnapshotTest {
)
}

ColumnComponentContainer {
ColumnComponentContainer(modifier = Modifier.padding(Spacing.Spacing10)) {
InputMatrix(
title = "Label",
data = inputCardData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package org.hisp.dhis.mobile.ui.designsystem

import android.graphics.Bitmap
import android.graphics.BitmapFactory
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.painter.BitmapPainter
Expand All @@ -12,6 +14,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.InputSequential
import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState
import org.hisp.dhis.mobile.ui.designsystem.component.internal.ImageCardData
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor
import org.junit.Rule
import org.junit.Test
Expand Down Expand Up @@ -79,7 +82,7 @@ class InputSequentialSnapshotTest {
)
}

ColumnComponentContainer {
ColumnComponentContainer(modifier = Modifier.padding(Spacing.Spacing10)) {
InputSequential(
title = "Label",
data = inputCardData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.hisp.dhis.mobile.ui.designsystem

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Login
import androidx.compose.material3.Icon
Expand All @@ -17,6 +18,7 @@ import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState
import org.hisp.dhis.mobile.ui.designsystem.component.InputUser
import org.hisp.dhis.mobile.ui.designsystem.component.model.InputPasswordModel
import org.hisp.dhis.mobile.ui.designsystem.component.model.InputUserModel
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.junit.Rule
import org.junit.Test

Expand All @@ -28,7 +30,7 @@ class LoginSnapshotTest {
@Test
fun launchLoginScreen() {
paparazzi.snapshot {
ColumnComponentContainer(title = "Login") {
ColumnComponentContainer(title = "Login", modifier = Modifier.padding(Spacing.Spacing10)) {
InputQRCode(
"Server URL",
inputTextFieldValue = TextFieldValue("https://play.dhis2.org/40"),
Expand Down

0 comments on commit 387f11d

Please sign in to comment.