Skip to content

Add JUnit 5 tests for IslandTeamInviteGUI#2831

Merged
tastybento merged 1 commit intodevelopfrom
worktree-island-team-invite-gui
Mar 4, 2026
Merged

Add JUnit 5 tests for IslandTeamInviteGUI#2831
tastybento merged 1 commit intodevelopfrom
worktree-island-team-invite-gui

Conversation

@tastybento
Copy link
Member

Summary

  • Adds IslandTeamInviteGUITest with 23 JUnit 5 tests for IslandTeamInviteGUI
  • Extends RanksManagerTestSetup and uses MockBukkit for the server mock
  • Copies panel YAML files to a per-test temp directory so TemplateReader loads real templates

Test coverage

Category Tests
Constructor File exists → no saveResource; file missing → saveResource called
build() Opens inventory; blank prospects with no players; click handler present for visible player; no handler for already-invited player; search name filters prospects by prefix
Pagination NEXT/PREVIOUS shown/hidden correctly; clicking NEXT advances page and reveals PREVIOUS; clicking PREVIOUS decrements page
BACK button inviteCmd=true closes inventory; inviteCmd=false also closes inventory
Prospect click handlers LEFT→invite (success + failure); RIGHT→coop; SHIFT_LEFT→trust; unknown click type ignored
InviteNamePrompt getPromptText returns translation; success ends conversation without rebuild; failed canExecute/execute schedules rebuild

Test plan

  • All 23 tests pass locally (./gradlew test --tests "...IslandTeamInviteGUITest")

🤖 Generated with Claude Code

23 tests covering constructor behaviour, panel building with various
player/search configurations, NEXT/PREVIOUS pagination, BACK button,
all three prospect click-handler actions (invite, coop, trust), and the
InviteNamePrompt inner class.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

@tastybento tastybento merged commit 95019cc into develop Mar 4, 2026
3 checks passed
@tastybento tastybento deleted the worktree-island-team-invite-gui branch March 4, 2026 06:47
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