Fix #21804 : Admin users cannot see private teams in the "Teams" selection dropdown (#21805)

* fix teams listing issue for admin users

* added e2e test

* address pr comment

* address pr comment
This commit is contained in:
Shrushti Polekar 2025-06-18 11:08:22 +05:30 committed by GitHub
parent a09a696358
commit 768a8ef422
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 3 deletions

View File

@ -29,6 +29,7 @@ import {
redirectToHomePage,
toastNotification,
uuid,
visitOwnProfilePage,
} from '../../utils/common';
import { addMultiOwner } from '../../utils/entity';
import { settingClick } from '../../utils/sidebar';
@ -400,7 +401,9 @@ test.describe('Teams Page', () => {
await hardDeleteTeam(page);
});
test('Create a new private team', async ({ page }) => {
test('Create a new private team and check if its visible to admin in teams selection dropdown on user profile', async ({
page,
}) => {
await settingClick(page, GlobalSettingOptions.TEAMS);
await page.waitForSelector('[data-testid="add-team"]');
@ -421,7 +424,33 @@ test.describe('Teams Page', () => {
'false'
);
await clickOutside(page);
await visitOwnProfilePage(page);
await page.waitForLoadState('networkidle');
await page.getByTestId('edit-teams-button').click();
await page.getByTestId('team-select').click();
await expect(page.getByTestId('profile-teams-edit-popover')).toBeVisible();
await page
.getByTestId('profile-teams-edit-popover')
.getByText(publicTeam.displayName)
.click();
const updateUserResponse = page.waitForResponse('/api/v1/users/*');
await page.getByTestId('teams-edit-save-btn').click();
await updateUserResponse;
await expect(
page.getByTestId('profile-teams-edit-popover')
).not.toBeVisible();
await page
.getByTestId('user-profile-teams')
.getByText(publicTeam.displayName)
.click();
await page.waitForLoadState('networkidle');
await hardDeleteTeam(page);
});

View File

@ -149,7 +149,6 @@ const UserProfileTeams = ({
borderRadius: '5px',
}}>
<TeamsSelectableNew
filterJoinable
handleDropdownChange={handleDropdownChange}
maxValueCount={3}
ref={teamsSelectableRef}