Skip to content

Conversation

@MozhganPeivandianSharbaf
Copy link
Contributor

…enter functionality

PP-1463

@MozhganPeivandianSharbaf MozhganPeivandianSharbaf changed the title feat(capture-sdk): add UI tests for AnalysisFragment and enhance pres… feat(capture-sdk): add UI tests for AnalysisFragment Nov 27, 2025
Copy link

Copilot AI left a 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 AnalysisScreenPresenterTest validating the showAlreadyPaidHint method behavior
  • Added UI test to AnalysisFragmentTest verifying the warning bottom sheet display functionality
  • Modified AnalysisScreenPresenterExtension to expose handleSaveInvoicesLocally and doWhenEducationFinished methods 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) {
Copy link

Copilot AI Nov 27, 2025

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.

Suggested change
fun doWhenEducationFinished(action: () -> Unit) {
fun doWhenEducationFinished(action: () -> Unit) {

Copilot uses AI. Check for mistakes.
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import io.mockk.slot
Copy link

Copilot AI Nov 27, 2025

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.

Suggested change
import io.mockk.slot

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +70
import kotlin.invoke
import kotlin.run
import kotlin.text.get
Copy link

Copilot AI Nov 27, 2025

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.

Suggested change
import kotlin.invoke
import kotlin.run
import kotlin.text.get

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants