Skip to content
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

Feature/#23 story detail #28

Merged
merged 4 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified feature/story/build/jacoco/testDemoDebugUnitTest.exec
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
2
7
0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
2
9
0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
52 changes: 20 additions & 32 deletions feature/story/build/reports/tests/testDemoDebugUnitTest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ <h1>Test Summary</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">1</div>
<div class="counter">4</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">1</div>
<div class="counter">0</div>
<p>failures</p>
</div>
</td>
Expand All @@ -38,7 +38,7 @@ <h1>Test Summary</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">6.092s</div>
<div class="counter">0.455s</div>
<p>duration</p>
</div>
</td>
Expand All @@ -47,8 +47,8 @@ <h1>Test Summary</h1>
</div>
</td>
<td>
<div class="infoBox failures" id="successRate">
<div class="percent">0%</div>
<div class="infoBox success" id="successRate">
<div class="percent">100%</div>
<p>successful</p>
</div>
</td>
Expand All @@ -58,25 +58,13 @@ <h1>Test Summary</h1>
<div id="tabs">
<ul class="tabLinks">
<li>
<a href="#tab0">Failed tests</a>
</li>
<li>
<a href="#tab1">Packages</a>
<a href="#tab0">Packages</a>
</li>
<li>
<a href="#tab2">Classes</a>
<a href="#tab1">Classes</a>
</li>
</ul>
<div id="tab0" class="tab">
<h2>Failed tests</h2>
<ul class="linkList">
<li>
<a href="classes/com.najudoryeong.mineme.feature.story.StoryScreenShotTests.html">StoryScreenShotTests</a>.
<a href="classes/com.najudoryeong.mineme.feature.story.StoryScreenShotTests.html#storyCalendarScreen">storyCalendarScreen</a>
</li>
</ul>
</div>
<div id="tab1" class="tab">
<h2>Packages</h2>
<table>
<thead>
Expand All @@ -91,19 +79,19 @@ <h2>Packages</h2>
</thead>
<tbody>
<tr>
<td class="failures">
<td class="success">
<a href="packages/com.najudoryeong.mineme.feature.story.html">com.najudoryeong.mineme.feature.story</a>
</td>
<td>1</td>
<td>1</td>
<td>4</td>
<td>0</td>
<td>0</td>
<td>6.092s</td>
<td class="failures">0%</td>
<td>0.455s</td>
<td class="success">100%</td>
</tr>
</tbody>
</table>
</div>
<div id="tab2" class="tab">
<div id="tab1" class="tab">
<h2>Classes</h2>
<table>
<thead>
Expand All @@ -118,14 +106,14 @@ <h2>Classes</h2>
</thead>
<tbody>
<tr>
<td class="failures">
<a href="classes/com.najudoryeong.mineme.feature.story.StoryScreenShotTests.html">com.najudoryeong.mineme.feature.story.StoryScreenShotTests</a>
<td class="success">
<a href="classes/com.najudoryeong.mineme.feature.story.WriteViewModelTest.html">com.najudoryeong.mineme.feature.story.WriteViewModelTest</a>
</td>
<td>1</td>
<td>1</td>
<td>4</td>
<td>0</td>
<td>0</td>
<td>6.092s</td>
<td class="failures">0%</td>
<td>0.455s</td>
<td class="success">100%</td>
</tr>
</tbody>
</table>
Expand All @@ -138,7 +126,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 8.2</a> at 2023. 9. 26. 오후 3:52:02</p>
<a href="http://www.gradle.org">Gradle 8.2</a> at 2023. 9. 28. 오후 7:55:25</p>
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ <h1>Package com.najudoryeong.mineme.feature.story</h1>
<tr>
<td>
<div class="infoBox" id="tests">
<div class="counter">1</div>
<div class="counter">4</div>
<p>tests</p>
</div>
</td>
<td>
<div class="infoBox" id="failures">
<div class="counter">1</div>
<div class="counter">0</div>
<p>failures</p>
</div>
</td>
Expand All @@ -40,7 +40,7 @@ <h1>Package com.najudoryeong.mineme.feature.story</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">6.092s</div>
<div class="counter">0.455s</div>
<p>duration</p>
</div>
</td>
Expand All @@ -49,8 +49,8 @@ <h1>Package com.najudoryeong.mineme.feature.story</h1>
</div>
</td>
<td>
<div class="infoBox failures" id="successRate">
<div class="percent">0%</div>
<div class="infoBox success" id="successRate">
<div class="percent">100%</div>
<p>successful</p>
</div>
</td>
Expand All @@ -60,22 +60,10 @@ <h1>Package com.najudoryeong.mineme.feature.story</h1>
<div id="tabs">
<ul class="tabLinks">
<li>
<a href="#tab0">Failed tests</a>
</li>
<li>
<a href="#tab1">Classes</a>
<a href="#tab0">Classes</a>
</li>
</ul>
<div id="tab0" class="tab">
<h2>Failed tests</h2>
<ul class="linkList">
<li>
<a href="../classes/com.najudoryeong.mineme.feature.story.StoryScreenShotTests.html">StoryScreenShotTests</a>.
<a href="../classes/com.najudoryeong.mineme.feature.story.StoryScreenShotTests.html#storyCalendarScreen">storyCalendarScreen</a>
</li>
</ul>
</div>
<div id="tab1" class="tab">
<h2>Classes</h2>
<table>
<thread>
Expand All @@ -89,14 +77,14 @@ <h2>Classes</h2>
</tr>
</thread>
<tr>
<td class="failures">
<a href="../classes/com.najudoryeong.mineme.feature.story.StoryScreenShotTests.html">StoryScreenShotTests</a>
<td class="success">
<a href="../classes/com.najudoryeong.mineme.feature.story.WriteViewModelTest.html">WriteViewModelTest</a>
</td>
<td>1</td>
<td>1</td>
<td>4</td>
<td>0</td>
<td>0</td>
<td>6.092s</td>
<td class="failures">0%</td>
<td>0.455s</td>
<td class="success">100%</td>
</tr>
</table>
</div>
Expand All @@ -108,7 +96,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 8.2</a> at 2023. 9. 26. 오후 3:52:02</p>
<a href="http://www.gradle.org">Gradle 8.2</a> at 2023. 9. 28. 오후 7:55:25</p>
</div>
</div>
</body>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@org.robolectric.annotation.GraphicsMode(value = org.robolectric.annotation.GraphicsMode.Mode.NATIVE)
@org.robolectric.annotation.Config(application = dagger.hilt.android.testing.HiltTestApplication.class, sdk = {33})
@org.robolectric.annotation.LooperMode(value = org.robolectric.annotation.LooperMode.Mode.PAUSED)
@kotlin.Metadata(mv = {1, 9, 0}, k = 1, xi = 48, d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\b\u0007\u0018\u00002\u00020\u0001B\u0005\u00a2\u0006\u0002\u0010\u0002J\b\u0010\u000e\u001a\u00020\u000fH\u0007J\b\u0010\u0010\u001a\u00020\u000fH\u0007J\b\u0010\u0011\u001a\u00020\u000fH\u0007J\b\u0010\u0012\u001a\u00020\u000fH\u0007R%\u0010\u0003\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u0005\u0012\u0004\u0012\u00020\u00060\u00048G\u00a2\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u000e\u0010\t\u001a\u00020\nX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\fX\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0013"}, d2 = {"Lcom/najudoryeong/mineme/feature/story/StoryScreenShotTests;", "", "()V", "composeTestRule", "Landroidx/compose/ui/test/junit4/AndroidComposeTestRule;", "Landroidx/test/ext/junit/rules/ActivityScenarioRule;", "Landroidx/activity/ComponentActivity;", "getComposeTestRule", "()Landroidx/compose/ui/test/junit4/AndroidComposeTestRule;", "storyCalendarResource", "Lcom/najudoryeong/mineme/core/model/data/StoryCalendarResource;", "storyRegionResource", "Lcom/najudoryeong/mineme/core/model/data/StoryRegionResource;", "storyRegionResourceEmpty", "setTimeZone", "", "storyCalendarScreen", "storyRegionEmptyScreen", "storyRegionScreen", "story_demoDebugUnitTest"})
@kotlin.Metadata(mv = {1, 9, 0}, k = 1, xi = 48, d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u0005\u00a2\u0006\u0002\u0010\u0002J\b\u0010\u000e\u001a\u00020\u000fH\u0007J\b\u0010\u0010\u001a\u00020\u000fH\u0007J\b\u0010\u0011\u001a\u00020\u000fH\u0007R%\u0010\u0003\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u0005\u0012\u0004\u0012\u00020\u00060\u00048G\u00a2\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u000e\u0010\t\u001a\u00020\nX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\fX\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0012"}, d2 = {"Lcom/najudoryeong/mineme/feature/story/StoryScreenShotTests;", "", "()V", "composeTestRule", "Landroidx/compose/ui/test/junit4/AndroidComposeTestRule;", "Landroidx/test/ext/junit/rules/ActivityScenarioRule;", "Landroidx/activity/ComponentActivity;", "getComposeTestRule", "()Landroidx/compose/ui/test/junit4/AndroidComposeTestRule;", "storyCalendarResource", "Lcom/najudoryeong/mineme/core/model/data/StoryCalendarResource;", "storyRegionResource", "Lcom/najudoryeong/mineme/core/model/data/StoryRegionResource;", "storyRegionResourceEmpty", "setTimeZone", "", "storyRegionEmptyScreen", "storyRegionScreen", "story_demoDebugUnitTest"})
public final class StoryScreenShotTests {
@org.jetbrains.annotations.NotNull
private final androidx.compose.ui.test.junit4.AndroidComposeTestRule<androidx.test.ext.junit.rules.ActivityScenarioRule<androidx.activity.ComponentActivity>, androidx.activity.ComponentActivity> composeTestRule = null;
Expand Down Expand Up @@ -36,8 +36,4 @@ public final void storyRegionScreen() {
@org.junit.Test
public final void storyRegionEmptyScreen() {
}

@org.junit.Test
public final void storyCalendarScreen() {
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ internal fun WriteStoryRoute(

@Composable
fun WriteStoryFirstPageScreen(
onContinueClicked: () -> Unit,
modifier: Modifier = Modifier,
onBackClick: () -> Unit,
onContinueClicked: () -> Unit = {},
onBackClick: () -> Unit = {},
selectedDate: LocalDate,
updateDate: (Int, Int, Int) -> Unit,
allRegions: List<String>,
allCities: List<String>,
updateRegion: (String) -> Unit,
updateCity: (String) -> Unit,
updateImages: (List<Uri>) -> Unit,
updateDate: (Int, Int, Int) -> Unit = {_,_,_ -> },
allRegions: List<String> = emptyList(),
allCities: List<String> = emptyList(),
updateRegion: (String) -> Unit = {},
updateCity: (String) -> Unit = {},
updateImages: (List<Uri>) -> Unit = {},
) {

val imagePicker =
Expand Down Expand Up @@ -199,13 +199,13 @@ fun WriteStoryFirstPageScreen(
@Composable
fun WriteStorySecondPageScreen(
modifier: Modifier = Modifier,
onBackClick: () -> Unit,
onBackClick: () -> Unit = {},
selectedDate: LocalDate,
selectedRegion: String,
selectedCity: String,
selectedImages: List<Uri>,
completeWriteStory: () -> Unit,
firstOnBackClick: () -> Unit,
completeWriteStory: () -> Unit = {},
firstOnBackClick: () -> Unit = {},
storyContent: MutableState<String>

) {
Expand Down Expand Up @@ -243,7 +243,7 @@ fun WriteStorySecondPageScreen(

OutlinedTextField(
value = storyContent.value,
onValueChange = { newValue -> storyContent.value = newValue},
onValueChange = { newValue -> storyContent.value = newValue },
label = { Text(text = stringResource(R.string.story_content_placeholder)) },
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package com.najudoryeong.mineme.feature.story

import android.net.Uri
import androidx.activity.ComponentActivity
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import com.najudoryeong.mineme.core.designsystem.theme.DoTheme
import com.najudoryeong.mineme.core.testing.util.captureMultiDevice
import dagger.hilt.android.testing.HiltTestApplication
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.annotation.GraphicsMode
import org.robolectric.annotation.LooperMode
import java.time.LocalDate


@RunWith(RobolectricTestRunner::class)
@GraphicsMode(GraphicsMode.Mode.NATIVE)
@Config(application = HiltTestApplication::class, sdk = [33])
@LooperMode(LooperMode.Mode.PAUSED)
class WriteStoryScreenShotTests {

@get:Rule
val composeTestRule = createAndroidComposeRule<ComponentActivity>()


@Test
fun writeStoryFirstPageScreen() {
composeTestRule.captureMultiDevice("FirstPage") {
DoTheme {
WriteStoryFirstPageScreen(
allRegions = koreanProvinces,
allCities = koreanCities[koreanProvinces.first()] ?: emptyList(),
selectedDate = LocalDate.now()
)
}
}
}


@Test
fun writeStorySecondPageScreen() {

val mockUris = listOf(
Uri.parse("https://example.com/image1.jpg"),
Uri.parse("https://example.com/image2.jpg")
)
val mockStoryContent = mutableStateOf("This is a sample story content.")

composeTestRule.captureMultiDevice("SecondPage") {
DoTheme {
WriteStorySecondPageScreen(
selectedDate = LocalDate.now(),
selectedRegion = "서울특별시",
selectedCity = "강남구",
selectedImages = mockUris,
storyContent = mockStoryContent
)
}
}
}


}
Loading