-
Notifications
You must be signed in to change notification settings - Fork 1
feat(capture-sdk): add UI tests for AnalysisFragment #863
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
base: main
Are you sure you want to change the base?
Conversation
…enter functionality PP-1463
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances test coverage for the AnalysisFragment and AnalysisScreenPresenter components. It adds UI tests for the warning bottom sheet functionality and adds unit tests for the already paid hint feature in the presenter.
Key changes:
- Added two new test cases to
AnalysisScreenPresenterTestvalidating theshowAlreadyPaidHintmethod behavior - Added UI test to
AnalysisFragmentTestverifying the warning bottom sheet display functionality - Modified
AnalysisScreenPresenterExtensionto exposehandleSaveInvoicesLocallyanddoWhenEducationFinishedmethods for testing purposes
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
capture-sdk/sdk/src/test/java/net/gini/android/capture/analysis/AnalysisScreenPresenterTest.kt |
Added imports for mockk and Mockito utilities, added two test cases for showAlreadyPaidHint method covering both code paths |
capture-sdk/sdk/src/test/java/net/gini/android/capture/analysis/AnalysisFragmentTest.kt |
Added UI test to verify warning bottom sheet is properly displayed with correct type and listener |
capture-sdk/sdk/src/main/java/net/gini/android/capture/analysis/AnalysisScreenPresenterExtension.kt |
Changed visibility of handleSaveInvoicesLocally and doWhenEducationFinished from private to public to enable testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| private fun doWhenEducationFinished(action: () -> Unit) { | ||
| fun doWhenEducationFinished(action: () -> Unit) { |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an extra space before fun creating inconsistent indentation. The line should start with 4 spaces (one indentation level) like other methods in this class, not 5 spaces.
| fun doWhenEducationFinished(action: () -> Unit) { | |
| fun doWhenEducationFinished(action: () -> Unit) { |
| import io.mockk.every | ||
| import io.mockk.just | ||
| import io.mockk.mockk | ||
| import io.mockk.slot |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import io.mockk.slot is declared but never used in this test file. Consider removing it to keep imports clean.
| import io.mockk.slot |
| import kotlin.invoke | ||
| import kotlin.run | ||
| import kotlin.text.get |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The imports kotlin.invoke, kotlin.run, and kotlin.text.get appear to be unused in this file. These are typically auto-imported by Kotlin, and explicit imports are unnecessary. Consider removing them to keep the import section clean.
| import kotlin.invoke | |
| import kotlin.run | |
| import kotlin.text.get |
…enter functionality
PP-1463