From 051c24c65d9e4461b7b14bb65a0f1e5fd67adb91 Mon Sep 17 00:00:00 2001 From: 2018JunYoungLim Date: Mon, 4 Dec 2023 02:08:15 +0900 Subject: [PATCH] fix: build error, button design --- .../src/main/java/com/goliath/emojihub/views/EmojiPage.kt | 2 +- .../emojihub/repositories/remote/EmojiRepositoryImplTest.kt | 2 +- .../com/goliath/emojihub/usecases/EmojiUseCaseImplTest.kt | 6 +++--- .../com/goliath/emojihub/viewmodels/EmojiViewModelTest.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/java/com/goliath/emojihub/views/EmojiPage.kt b/android/app/src/main/java/com/goliath/emojihub/views/EmojiPage.kt index 67da0474..537c8d39 100644 --- a/android/app/src/main/java/com/goliath/emojihub/views/EmojiPage.kt +++ b/android/app/src/main/java/com/goliath/emojihub/views/EmojiPage.kt @@ -117,7 +117,7 @@ fun EmojiPage( contentColor = White ) ) { - Text("Sort by Date", fontSize = 12.sp) + Text(text = if (viewModel.sortingMode == 1) "Sort by Date" else "Sort by Save Count", fontSize = 12.sp) } } diff --git a/android/app/src/test/java/com/goliath/emojihub/repositories/remote/EmojiRepositoryImplTest.kt b/android/app/src/test/java/com/goliath/emojihub/repositories/remote/EmojiRepositoryImplTest.kt index ddac0fc5..403539f9 100644 --- a/android/app/src/test/java/com/goliath/emojihub/repositories/remote/EmojiRepositoryImplTest.kt +++ b/android/app/src/test/java/com/goliath/emojihub/repositories/remote/EmojiRepositoryImplTest.kt @@ -56,7 +56,7 @@ class EmojiRepositoryImplTest { emojiApi.fetchEmojiList(any(), any(), any()) } returns Response.success(sampleEmojiDtoList) // when - val fetchedEmojiPagingDataFlow = runBlocking { emojiRepositoryImpl.fetchEmojiList() } + val fetchedEmojiPagingDataFlow = runBlocking { emojiRepositoryImpl.fetchEmojiList(1) } val fetchedEmojiDtoList = runBlocking { fetchedEmojiPagingDataFlow.asSnapshot() } // then coVerify(exactly = 2) { emojiApi.fetchEmojiList(any(), any(), any()) } diff --git a/android/app/src/test/java/com/goliath/emojihub/usecases/EmojiUseCaseImplTest.kt b/android/app/src/test/java/com/goliath/emojihub/usecases/EmojiUseCaseImplTest.kt index 0cc91866..3058110a 100644 --- a/android/app/src/test/java/com/goliath/emojihub/usecases/EmojiUseCaseImplTest.kt +++ b/android/app/src/test/java/com/goliath/emojihub/usecases/EmojiUseCaseImplTest.kt @@ -75,12 +75,12 @@ class EmojiUseCaseImplTest { val sampleEmojiPagingDataFlow = createDeterministicDummyEmojiDtoList(5) val sampleAnswer = sampleEmojiPagingDataFlow.map { it.map { dto -> Emoji(dto) } } coEvery { - emojiRepository.fetchEmojiList() + emojiRepository.fetchEmojiList(1) } returns sampleEmojiPagingDataFlow // when - val fetchedEmojiPagingDataFlow = runBlocking { emojiUseCaseImpl.fetchEmojiList() } + val fetchedEmojiPagingDataFlow = runBlocking { emojiUseCaseImpl.fetchEmojiList(1) } // then - coVerify(exactly = 1) { emojiRepository.fetchEmojiList() } + coVerify(exactly = 1) { emojiRepository.fetchEmojiList(1) } runBlocking { val sampleAnswerAsSnapshot = sampleAnswer.asSnapshot() val fetchedEmojiPagingDataFlowAsSnapshot = fetchedEmojiPagingDataFlow.asSnapshot() diff --git a/android/app/src/test/java/com/goliath/emojihub/viewmodels/EmojiViewModelTest.kt b/android/app/src/test/java/com/goliath/emojihub/viewmodels/EmojiViewModelTest.kt index 8e5ba46c..1160ab0d 100644 --- a/android/app/src/test/java/com/goliath/emojihub/viewmodels/EmojiViewModelTest.kt +++ b/android/app/src/test/java/com/goliath/emojihub/viewmodels/EmojiViewModelTest.kt @@ -51,7 +51,7 @@ class EmojiViewModelTest { emojiUseCase.fetchEmojiList(1) } returns sampleFetchedEmojiList // when - emojiViewModel.fetchEmojiList(1) + emojiViewModel.fetchEmojiList() advanceUntilIdle() // then coVerify(exactly = 1) { emojiUseCase.fetchEmojiList(1) }