-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: remove usage of uninstall modules (#981)
* test: move the compose rule into the base test class Move the compose test rule into the base test class so its always created. Also create a new mock auth module for the AuthApi. * test: add test modules for the api calls * chore: downgrade mockk to 1.13.3 MockK after 1.13.3 seems to have an issue with mocking some interface classes, downgrade to 1.13.3 to fix this for now.
- Loading branch information
Showing
19 changed files
with
128 additions
and
88 deletions.
There are no files selected for viewing
This file contains 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
5 changes: 0 additions & 5 deletions
5
app/src/androidTest/java/com/chesire/nekome/features/ActivityTests.kt
This file contains 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
15 changes: 3 additions & 12 deletions
15
app/src/androidTest/java/com/chesire/nekome/features/login/CredentialsTests.kt
This file contains 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
45 changes: 17 additions & 28 deletions
45
app/src/androidTest/java/com/chesire/nekome/features/login/LoginFlowTests.kt
This file contains 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: 9 additions & 14 deletions
23
app/src/androidTest/java/com/chesire/nekome/features/search/SearchTests.kt
This file contains 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 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
15 changes: 3 additions & 12 deletions
15
app/src/androidTest/java/com/chesire/nekome/features/series/SeriesListTests.kt
This file contains 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 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
5 changes: 0 additions & 5 deletions
5
app/src/androidTest/java/com/chesire/nekome/features/settings/SettingsTests.kt
This file contains 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
21 changes: 21 additions & 0 deletions
21
app/src/androidTest/java/com/chesire/nekome/injection/MockAuthModule.kt
This file contains 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,21 @@ | ||
package com.chesire.nekome.injection | ||
|
||
import com.chesire.nekome.datasource.auth.remote.AuthApi | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.Reusable | ||
import dagger.hilt.components.SingletonComponent | ||
import dagger.hilt.testing.TestInstallIn | ||
import io.mockk.mockk | ||
|
||
@Module | ||
@TestInstallIn( | ||
components = [SingletonComponent::class], | ||
replaces = [AuthModule::class] | ||
) | ||
class MockAuthModule { | ||
|
||
@Provides | ||
@Reusable | ||
fun provideApi() = mockk<AuthApi>() | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/androidTest/java/com/chesire/nekome/injection/MockLibraryModule.kt
This file contains 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,21 @@ | ||
package com.chesire.nekome.injection | ||
|
||
import com.chesire.nekome.datasource.series.remote.SeriesApi | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.Reusable | ||
import dagger.hilt.components.SingletonComponent | ||
import dagger.hilt.testing.TestInstallIn | ||
import io.mockk.mockk | ||
|
||
@Module | ||
@TestInstallIn( | ||
components = [SingletonComponent::class], | ||
replaces = [LibraryModule::class] | ||
) | ||
class MockLibraryModule { | ||
|
||
@Provides | ||
@Reusable | ||
fun provideApi() = mockk<SeriesApi>() | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/androidTest/java/com/chesire/nekome/injection/MockSearchModule.kt
This file contains 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,21 @@ | ||
package com.chesire.nekome.injection | ||
|
||
import com.chesire.nekome.datasource.search.remote.SearchApi | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.Reusable | ||
import dagger.hilt.components.SingletonComponent | ||
import dagger.hilt.testing.TestInstallIn | ||
import io.mockk.mockk | ||
|
||
@Module | ||
@TestInstallIn( | ||
components = [SingletonComponent::class], | ||
replaces = [SearchModule::class] | ||
) | ||
class MockSearchModule { | ||
|
||
@Provides | ||
@Reusable | ||
fun provideApi() = mockk<SearchApi>() | ||
} |
Oops, something went wrong.