-
Notifications
You must be signed in to change notification settings - Fork 0
feat: upcoming tab #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: upcoming tab #198
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
aa292b8
Redesigned navigation with bottom tabs.
opencode-agent[bot] 694b1fd
Merge branch 'main' into opencode/issue137-20260726143735
MessiasLima a7837de
Restored nav scaffold, added Upcoming.
opencode-agent[bot] 3b18c28
Reverted ProfileScreen redesign.
opencode-agent[bot] 20fad88
Merge branch 'main' into opencode/issue137-20260726143735
MessiasLima 556ee18
extract navigaton
MessiasLima b25fa78
bump compose test version
MessiasLima 6212b84
headless tests
MessiasLima 649d259
info on test fails
MessiasLima 13acd2b
always
MessiasLima 9cfa5bb
test tags instead of strings
MessiasLima 53cdb1c
remove stack trace
MessiasLima File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
39 changes: 39 additions & 0 deletions
39
foliary/src/commonMain/kotlin/dev/appoutlet/foliary/feature/upcoming/UpcomingScreen.kt
This file contains hidden or 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,39 @@ | ||
| package dev.appoutlet.foliary.feature.upcoming | ||
|
|
||
| import androidx.compose.foundation.layout.WindowInsets | ||
| import androidx.compose.foundation.layout.WindowInsetsSides | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.only | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.safeDrawing | ||
| import androidx.compose.foundation.layout.windowInsetsPadding | ||
| import androidx.compose.foundation.lazy.LazyColumn | ||
| import androidx.compose.foundation.lazy.LazyListState | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.platform.testTag | ||
| import androidx.compose.ui.unit.dp | ||
| import foliary.foliary.generated.resources.Res | ||
| import foliary.foliary.generated.resources.upcoming_title | ||
| import org.jetbrains.compose.resources.stringResource | ||
|
|
||
| @Composable | ||
| fun UpcomingScreen(lazyListState: LazyListState) { | ||
| LazyColumn( | ||
| modifier = Modifier | ||
| .testTag("UpcomingScreen") | ||
| .windowInsetsPadding(WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)) | ||
| .fillMaxSize(), | ||
| state = lazyListState, | ||
| ) { | ||
| item { | ||
| Text( | ||
| modifier = Modifier.padding(16.dp), | ||
| text = stringResource(Res.string.upcoming_title), | ||
| style = MaterialTheme.typography.displaySmall | ||
| ) | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
52 changes: 52 additions & 0 deletions
52
foliary/src/commonTest/kotlin/dev/appoutlet/foliary/feature/main/MainScreenTest.kt
This file contains hidden or 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,52 @@ | ||
| package dev.appoutlet.foliary.feature.main | ||
|
|
||
| import androidx.compose.runtime.CompositionLocalProvider | ||
| import androidx.compose.ui.test.ExperimentalTestApi | ||
| import androidx.compose.ui.test.assertIsDisplayed | ||
| import androidx.compose.ui.test.hasTestTag | ||
| import androidx.compose.ui.test.onNodeWithTag | ||
| import androidx.compose.ui.test.performClick | ||
| import androidx.compose.ui.test.v2.runComposeUiTest | ||
| import androidx.compose.ui.test.waitUntilAtLeastOneExists | ||
| import dev.appoutlet.foliary.FoliaryKoinApplication | ||
| import dev.appoutlet.foliary.core.analytics.LocalAnalytics | ||
| import dev.appoutlet.foliary.core.analytics.MockAnalytics | ||
| import org.koin.core.context.stopKoin | ||
| import org.koin.plugin.module.dsl.startKoin | ||
| import kotlin.test.AfterTest | ||
| import kotlin.test.BeforeTest | ||
| import kotlin.test.Test | ||
|
|
||
| @OptIn(ExperimentalTestApi::class) | ||
| class MainScreenTest { | ||
| private val mockAnalytics = MockAnalytics() | ||
|
|
||
| @BeforeTest | ||
| fun setup() { | ||
| startKoin<FoliaryKoinApplication>() | ||
| } | ||
|
|
||
| @AfterTest | ||
| fun tearDown() { | ||
| stopKoin() | ||
| } | ||
|
|
||
| @Test | ||
| fun `should render bottom navigation with three tabs`() = runComposeUiTest { | ||
| setContent { | ||
| CompositionLocalProvider(LocalAnalytics provides mockAnalytics) { | ||
| MainScreen() | ||
| } | ||
| } | ||
|
|
||
| waitUntilAtLeastOneExists(hasTestTag("TodayScreen")) | ||
|
|
||
| onNodeWithTag("MainScreen:TodayTab").assertIsDisplayed() | ||
|
|
||
| onNodeWithTag("MainScreen:UpcomingTab").assertIsDisplayed().performClick() | ||
| waitUntilAtLeastOneExists(hasTestTag("UpcomingScreen")) | ||
|
|
||
| onNodeWithTag("MainScreen:ProfileTab").assertIsDisplayed().performClick() | ||
| waitUntilAtLeastOneExists(hasTestTag("ProfileScreen")) | ||
| } | ||
| } |
34 changes: 34 additions & 0 deletions
34
foliary/src/commonTest/kotlin/dev/appoutlet/foliary/feature/main/MainViewModelTest.kt
This file contains hidden or 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,34 @@ | ||
| package dev.appoutlet.foliary.feature.main | ||
|
|
||
| import dev.appoutlet.foliary.core.testing.ViewModelTest | ||
| import io.kotest.matchers.shouldBe | ||
| import kotlin.test.Test | ||
|
|
||
| class MainViewModelTest : ViewModelTest<MainViewModel, MainViewData, MainAction>() { | ||
| override fun createViewModel() = MainViewModel() | ||
|
|
||
| @Test | ||
| fun `should select today tab by default`() { | ||
| test { | ||
| currentState.selectedTab shouldBe MainTab.Today | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| fun `should switch to upcoming tab`() { | ||
| test { | ||
| viewModel.onTabSelected(MainTab.Upcoming) | ||
|
|
||
| expectState { copy(selectedTab = MainTab.Upcoming) } | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| fun `should switch to profile tab`() { | ||
| test { | ||
| viewModel.onTabSelected(MainTab.Profile) | ||
|
|
||
| expectState { copy(selectedTab = MainTab.Profile) } | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
23 changes: 23 additions & 0 deletions
23
foliary/src/commonTest/kotlin/dev/appoutlet/foliary/feature/upcoming/UpcomingScreenTest.kt
This file contains hidden or 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,23 @@ | ||
| package dev.appoutlet.foliary.feature.upcoming | ||
|
|
||
| import androidx.compose.foundation.lazy.rememberLazyListState | ||
| import androidx.compose.ui.test.ExperimentalTestApi | ||
| import androidx.compose.ui.test.assertIsDisplayed | ||
| import androidx.compose.ui.test.onNodeWithText | ||
| import androidx.compose.ui.test.v2.runComposeUiTest | ||
| import foliary.foliary.generated.resources.Res | ||
| import foliary.foliary.generated.resources.upcoming_title | ||
| import org.jetbrains.compose.resources.getString | ||
| import kotlin.test.Test | ||
|
|
||
| @OptIn(ExperimentalTestApi::class) | ||
| class UpcomingScreenTest { | ||
| @Test | ||
| fun `should render upcoming title`() = runComposeUiTest { | ||
| setContent { | ||
| UpcomingScreen(lazyListState = rememberLazyListState()) | ||
| } | ||
|
|
||
| onNodeWithText(getString(Res.string.upcoming_title)).assertIsDisplayed() | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.