Skip to content

test: [MarkChaptersRemote] test coverage#2929

Open
nonproto wants to merge 1 commit intomainfrom
test-coverage-markchaptersremote-6049267990904438320
Open

test: [MarkChaptersRemote] test coverage#2929
nonproto wants to merge 1 commit intomainfrom
test-coverage-markchaptersremote-6049267990904438320

Conversation

@nonproto
Copy link
Copy Markdown
Collaborator

@nonproto nonproto commented Apr 4, 2026

💡 What: Added unit tests for MarkChaptersRemote UseCase to verify proper updating of merged and non-merged chapter reading statuses, as well as testing the skipSync early exit logic.

🎯 Why: Ensures regressions are not introduced to the MarkChaptersRemote syncing logic when dealing with mixed sets of chapters and that the skipSync parameter accurately prevents unnecessary network calls.


PR created automatically by Jules for task 6049267990904438320 started by @nonproto

Added tests to verify `MarkChaptersRemote` handles merged/non-merged chapters
and conditionally bypasses external status calls when `skipSync` is true.

Co-authored-by: nonproto <2092019+nonproto@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces unit tests for the MarkChaptersRemote use case, specifically covering the skipSync edge case and the synchronization of mixed chapters. It also updates the project's testing documentation to reflect learnings regarding MockK verification. A review comment identified a compilation error in the test assertions where an invalid property was accessed on the chapter object, providing a suggestion to use the correct identifier property.

coVerify(exactly = 1) {
statusHandler.markMergedChaptersStatus(
chapters =
match { it.size == 1 && it.first().mangadex_chapter_id == "md-chapter-2" },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The property mangadex_chapter_id is not a member of the SChapter interface. In this project, the chapter identifier is typically stored in the url property of SChapter after conversion from SimpleChapter. Using an undefined property will cause a compilation error.

Suggested change
match { it.size == 1 && it.first().mangadex_chapter_id == "md-chapter-2" },
match { it.size == 1 && it.first().url == "md-chapter-2" },

@nonproto nonproto marked this pull request as ready for review April 5, 2026 04:04
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.

1 participant