Skip to content

Commit

Permalink
Merge pull request #5222 from Sage-Bionetworks/release-475
Browse files Browse the repository at this point in the history
merge release 475 to develop
  • Loading branch information
jay-hodgson authored Oct 27, 2023
2 parents 221b5d8 + 49cbb1c commit eace0e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,11 @@ public void onSuccess(TeamBundle result) {
!teamMembershipStatus.getIsMember()
)
) {
// not a member, is team locked down?
if (!isLockedDown) {
// not a member, show the Join Team button if the team is not locked down, or if the user has an open team invitation
boolean hasOpenInvitation =
teamMembershipStatus != null &&
teamMembershipStatus.getHasOpenInvitation();
if (!isLockedDown || hasOpenInvitation) {
// not locked down, add the Join team widget
joinTeamWidget.configure(
teamId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,4 +525,28 @@ public void testNotMemberOfLockedTeam() {
anyBoolean()
);
}

@Test
public void testNotMemberOfLockedTeamHasOpenInvite() {
boolean isAdmin = false;
when(mockTeamBundle.isUserAdmin()).thenReturn(isAdmin);
when(mockTeamMembershipStatus.getIsMember()).thenReturn(false);
when(mockTeamMembershipStatus.getHasOpenInvitation()).thenReturn(true);
when(mockTeam.getCanRequestMembership()).thenReturn(false);

presenter.refresh(teamId);

verify(mockJoinWidget)
.configure(
eq(teamId),
anyBoolean(),
eq(mockTeamMembershipStatus),
any(Callback.class),
anyString(),
anyString(),
anyString(),
anyString(),
anyBoolean()
);
}
}

0 comments on commit eace0e4

Please sign in to comment.