Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
35484fa
Refactor: Update color theme for transaction type button
LucasOliveiraSimao Aug 2, 2025
e83411e
Refactor: Improve InputText component styling
LucasOliveiraSimao Aug 2, 2025
0fe8f16
Refactor: adjust PetSelectorItem component
LucasOliveiraSimao Aug 2, 2025
1c2ef83
feat: create RegisterTaskScreen
LucasOliveiraSimao Aug 2, 2025
9e338fe
feat: Create TransactionTypeSelector component
LucasOliveiraSimao Aug 2, 2025
965c2de
feat: Create TransactionType enum
LucasOliveiraSimao Aug 2, 2025
0369937
Refactor: Rename DescriptionTextField to TextFieldCustom
LucasOliveiraSimao Aug 2, 2025
ac1d516
Refactor: Remove redundant strings and add recurrence strings
LucasOliveiraSimao Aug 2, 2025
6e8cf1b
Refactor: Adjust SelectableButton layout and style
LucasOliveiraSimao Aug 2, 2025
f00f787
feat: Create ScreenRegisterTask screen
LucasOliveiraSimao Aug 2, 2025
8340d39
feat: integrate ScreenRegisterTask into MainActivity
LucasOliveiraSimao Aug 2, 2025
9322455
Merge branch 'develop' into task-registration-screen
LucasOliveiraSimao Aug 2, 2025
5d37731
mudancas no button3 e adicao da expansao do taskcard
Aug 13, 2025
6e241a1
Finalizado o card em formato expandido
Aug 14, 2025
e46ad00
Adicionado Dummies para testar comportamento
Aug 14, 2025
f353582
adicionado icone vetorizado para os cards; adicionado campo para icon…
Aug 18, 2025
3dbb568
inicio da implementacao da tela
Aug 18, 2025
4a12d35
feat: Add unfocused color for WheelTimePicker
LucasOliveiraSimao Aug 30, 2025
be3d9e3
feat: Create DayPicker composable
LucasOliveiraSimao Aug 30, 2025
7bbde0f
feat: Create OneOffTask composable
LucasOliveiraSimao Aug 30, 2025
b0b471d
feat: Create PeriodSelector composable
LucasOliveiraSimao Aug 30, 2025
54ff2ba
feat: Create RecurringTask composable
LucasOliveiraSimao Aug 30, 2025
83b807f
Refactor: Make GroupSelectableButton dynamic
LucasOliveiraSimao Aug 30, 2025
0dce343
feat: Add SelectedPeriodType enum
LucasOliveiraSimao Aug 30, 2025
604a5f1
Refactor: Update TextFieldCustom padding and add new string resources
LucasOliveiraSimao Aug 30, 2025
45a57d4
feat: Create TimePickerWithPeriodSelector Composable
LucasOliveiraSimao Aug 30, 2025
a840ae9
Refactor: Adjust TransactionTypeSelector button size
LucasOliveiraSimao Aug 30, 2025
bc4cc3a
Refactor: Update WheelTimePicker component
LucasOliveiraSimao Aug 30, 2025
74938de
feat: Enhance ScreenRegisterTask UI and functionality
LucasOliveiraSimao Aug 30, 2025
ff3ecdf
Test: Add UI tests for ScreenRegisterTask components
LucasOliveiraSimao Aug 30, 2025
fc55fc0
Merge branch 'develop' into task-registration-screen
LucasOliveiraSimao Oct 7, 2025
9ac004d
Merge pull request #92 from PetJournal/feature/create-task-cards
gusoliveira21 Oct 12, 2025
98135aa
Refactor: Update color theme for transaction type button
LucasOliveiraSimao Aug 2, 2025
6cd5d54
Refactor: Improve InputText component styling
LucasOliveiraSimao Aug 2, 2025
fca4ac2
Refactor: adjust PetSelectorItem component
LucasOliveiraSimao Aug 2, 2025
4f3291a
feat: create RegisterTaskScreen
LucasOliveiraSimao Aug 2, 2025
80c7e49
feat: Create TransactionTypeSelector component
LucasOliveiraSimao Aug 2, 2025
66e9541
feat: Create TransactionType enum
LucasOliveiraSimao Aug 2, 2025
47bcb1c
Refactor: Rename DescriptionTextField to TextFieldCustom
LucasOliveiraSimao Aug 2, 2025
e37e6c8
Refactor: Remove redundant strings and add recurrence strings
LucasOliveiraSimao Aug 2, 2025
3ce4e77
Refactor: Adjust SelectableButton layout and style
LucasOliveiraSimao Aug 2, 2025
6bbc63c
feat: Create ScreenRegisterTask screen
LucasOliveiraSimao Aug 2, 2025
877916d
feat: integrate ScreenRegisterTask into MainActivity
LucasOliveiraSimao Aug 2, 2025
b297eb5
feat: Add unfocused color for WheelTimePicker
LucasOliveiraSimao Aug 30, 2025
58179ea
feat: Create DayPicker composable
LucasOliveiraSimao Aug 30, 2025
b79d4d1
feat: Create OneOffTask composable
LucasOliveiraSimao Aug 30, 2025
f80dfe9
feat: Create PeriodSelector composable
LucasOliveiraSimao Aug 30, 2025
ceefb67
feat: Create RecurringTask composable
LucasOliveiraSimao Aug 30, 2025
f2b51ba
Refactor: Make GroupSelectableButton dynamic
LucasOliveiraSimao Aug 30, 2025
1cc96ba
feat: Add SelectedPeriodType enum
LucasOliveiraSimao Aug 30, 2025
ba315cb
Refactor: Update TextFieldCustom padding and add new string resources
LucasOliveiraSimao Aug 30, 2025
4ea5e67
feat: Create TimePickerWithPeriodSelector Composable
LucasOliveiraSimao Aug 30, 2025
dcb9f30
Refactor: Adjust TransactionTypeSelector button size
LucasOliveiraSimao Aug 30, 2025
7a5a3f7
Refactor: Update WheelTimePicker component
LucasOliveiraSimao Aug 30, 2025
805ac72
feat: Enhance ScreenRegisterTask UI and functionality
LucasOliveiraSimao Aug 30, 2025
45bf5b2
Test: Add UI tests for ScreenRegisterTask components
LucasOliveiraSimao Aug 30, 2025
6e6bec9
Merge branch 'task-registration-screen' of https://github.com/PetJour…
gusoliveira21 Oct 29, 2025
c3b26bd
feat(ui): improve UI components styling and functionality
gusoliveira21 Oct 29, 2025
8e1a89c
refactor(strings): update pet registration string label
gusoliveira21 Oct 29, 2025
3af5ae5
fix(ui): apply temporary color fixes to TaskSuccessDialog
gusoliveira21 Oct 29, 2025
26f131e
feat(ui): improve register pet screen layout and add preview components
gusoliveira21 Oct 29, 2025
72a80bf
fix(navigation): update pet list route and add navigation functionality
gusoliveira21 Oct 29, 2025
511af56
fix(test): correct parameter order in RegisterPetScreenTest
gusoliveira21 Oct 29, 2025
a8d8f5e
test(deps): add mockk-android dependency for android tests
gusoliveira21 Nov 6, 2025
0ce481f
test(ui): add PetFilterList tests and expand ScreenRegisterTask tests
gusoliveira21 Nov 6, 2025
c4f3b6a
refactor(ui): improve UI components with spacing and test tags
gusoliveira21 Nov 6, 2025
fac9f5b
feat(ui): improve register task screen layout and functionality
gusoliveira21 Nov 6, 2025
63bc817
refactor(navigation): restore PresentationManager in MainActivity
gusoliveira21 Nov 6, 2025
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
3 changes: 2 additions & 1 deletion petJournal/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ dependencies {
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.arch.core:core-testing:2.1.0")

testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.2")
androidTestImplementation("io.mockk:mockk-android:1.12.0")
androidTestImplementation("io.mockk:mockk-agent:1.12.0")
testImplementation("junit:junit:4.13.2")
testImplementation("io.mockk:mockk:1.12.0")
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.25")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.soujunior.petjournal.componentes

import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.hasParent
import androidx.compose.ui.test.hasTestTag
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.performClick
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

import androidx.compose.ui.res.painterResource
import com.soujunior.petjournal.R // Para carregar imagens de preview
import com.soujunior.petjournal.ui.components.PetFilterList
import com.soujunior.petjournal.ui.components.Pets
import io.mockk.mockk
import org.mockito.Mockito.verify

@RunWith(AndroidJUnit4::class)
class PetFilterListTest {

@get:Rule
val composeTestRule = createComposeRule()

private val mockOnSelectedPet: (String) -> Unit = mockk(relaxed = true)

private val dummyPetList = listOf(
Pets(
id = 1,
imageRes = null,
name = "Jujuba"
),
Pets(
id = 2,
imageRes = null,
name = "Alfredo"
)
)

@Before
fun setUp() {
composeTestRule.setContent {
val listWithPainters = dummyPetList.map {
it.copy(imageRes = painterResource(id = R.drawable.penguim))
}

PetFilterList(
listPet = listWithPainters,
onSelectedPet = mockOnSelectedPet
)
}
}

@Test
fun test_PetFilterList_DisplaysItems() {
composeTestRule.onNodeWithTag("PetItem_Todos").assertIsDisplayed()
composeTestRule.onNodeWithTag("PetItem_Jujuba").assertIsDisplayed()
composeTestRule.onNodeWithTag("PetItem_Alfredo").assertIsDisplayed()
}

@Test
fun test_PetFilterList_SelectsAndDeselectsPet() {
val jujubaSelectedIconMatcher =
hasParent(hasTestTag("PetItem_Jujuba")) and hasTestTag("SelectedIcon")

composeTestRule.onNode(jujubaSelectedIconMatcher).assertDoesNotExist()

composeTestRule.onNodeWithTag("PetItem_Jujuba").performClick()

composeTestRule.onNode(jujubaSelectedIconMatcher).assertIsDisplayed()

composeTestRule.onNodeWithTag("PetItem_Jujuba").performClick()

composeTestRule.onNode(jujubaSelectedIconMatcher).assertDoesNotExist()
}

@Test
fun test_PetFilterList_CallbackIsCalledOnSelection() {
composeTestRule.onNodeWithTag("PetItem_Alfredo").performClick()

verify { mockOnSelectedPet("Alfredo") }

composeTestRule.onNodeWithTag("PetItem_Todos").performClick()

verify { mockOnSelectedPet("Todos") }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ class RegisterPetScreenTest {

composeTestRule.setContent {
InputText(
titleText = stringResource(R.string.pet_name),
placeholderText = stringResource(R.string.placeholder_name_pet),
titleText = stringResource(R.string.pet_name),
textValue = actualText,
onEvent = { actualText = it }
onEvent = { actualText = it },
)
}

Expand All @@ -81,9 +81,9 @@ class RegisterPetScreenTest {
InputText(
titleText = stringResource(R.string.pet_name),
textValue = "",
onEvent = {},
isError = true,
textError = listOf(errorMessage),
onEvent = {},
)
}

Expand Down
Loading
Loading