Fix : Feeds not getting updated on user profile change. (#20486)

* fix feeds not getting updated after user profile change

* fix feeds call happening with aftre payload on initial load

* playwright for feed user profile change
This commit is contained in:
Shrushti Polekar 2025-04-02 11:08:01 +05:30 committed by GitHub
parent 685b5702e8
commit 3ea4dbd10e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 49 additions and 10 deletions

View File

@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { test as base, expect, Page } from '@playwright/test';
import { expect, Page, test as base } from '@playwright/test';
import {
PROFILER_EMPTY_RESPONSE_CONFIG,
PROFILER_REQUEST_CONFIG,

View File

@ -449,3 +449,39 @@ test.describe('User with Data Steward Roles', () => {
await visitOwnProfilePage(dataStewardPage);
});
});
test.describe('User Profile Feed Interactions', () => {
test('Should navigate to user profile from feed card avatar click', async ({
adminPage,
}) => {
await redirectToHomePage(adminPage);
const feedResponse = adminPage.waitForResponse(
'/api/v1/feed?type=Conversation'
);
await visitOwnProfilePage(adminPage);
await feedResponse;
await adminPage.waitForSelector('[data-testid="message-container"]');
const userDetailsResponse = adminPage.waitForResponse(
'/api/v1/users/name/*'
);
const userFeedResponse = adminPage.waitForResponse(
'/api/v1/feed?type=Conversation&filterType=OWNER_OR_FOLLOWS&userId=*'
);
await adminPage
.locator('[data-testid="message-container"]')
.first()
.locator('[data-testid="profile-avatar"]')
.click();
await userDetailsResponse;
await userFeedResponse;
const response = await userDetailsResponse;
const { fullyQualifiedName } = await response.json();
await expect(
adminPage.locator('[data-testid="user-display-name"]')
).toHaveText(fullyQualifiedName);
});
});

View File

@ -19,8 +19,8 @@ import {
import { VISIT_SERVICE_PAGE_DETAILS } from '../constant/service';
import {
GlobalSettingOptions,
SETTING_CUSTOM_PROPERTIES_PATH,
SETTINGS_OPTIONS_PATH,
SETTING_CUSTOM_PROPERTIES_PATH,
} from '../constant/settings';
import { SidebarItem } from '../constant/sidebar';
import { UserClass } from '../support/user/UserClass';

View File

@ -536,13 +536,15 @@ export const ActivityFeedTab = ({
onFeedClick={handleFeedClick}
/>
{loader}
<div
className="w-full"
data-testid="observer-element"
id="observer-element"
ref={elementRef as RefObject<HTMLDivElement>}
style={{ height: '2px' }}
/>
{entityThread.length > 0 && (
<div
className="w-full"
data-testid="observer-element"
id="observer-element"
ref={elementRef as RefObject<HTMLDivElement>}
style={{ height: '2px' }}
/>
)}
</div>
<div

View File

@ -48,6 +48,7 @@ const UserPage = () => {
const { currentUser, updateCurrentUser } = useApplicationStore();
const fetchUserData = async () => {
setIsLoading(true);
try {
const res = await getUserByName(username, {
fields: [
@ -179,7 +180,7 @@ const UserPage = () => {
fetchUserData();
}, [username]);
if (isLoading) {
if (userData?.name !== username || isLoading) {
return <Loader />;
}