[MM-53636] Add channel/team name back for the Saved Posts view (#24117)

* [MM-53636] Add channel/team name back for the Saved Posts view

* E2E test
This commit is contained in:
Devin Binnie 2023-07-28 15:35:18 -04:00 committed by GitHub
parent 93a2c3281a
commit 047583947f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -40,6 +40,19 @@ describe('Post PreHeader', () => {
// * Assert the preHeader is displayed and works as expected
verifySavedPost(postId, message);
// # Click the saved link
cy.get('@savedLink').click();
// * Check that the saved post shows the channel name
cy.findByTestId('search-item-container').within(() => {
cy.get('span.search-channel__name').
should('be.visible').
and('have.text', 'Off-Topic');
});
// # Close the RHS
cy.get('#searchResultsCloseButton').should('be.visible').click();
// # Click again the center save icon of a post
cy.clickPostSaveIcon(postId);

View File

@ -527,7 +527,7 @@ const PostComponent = (props: Props): JSX.Element => {
className='search-channel__name__container'
aria-hidden='true'
>
{Boolean(isSearchResultItem) &&
{(Boolean(isSearchResultItem) || props.isFlaggedPosts) &&
<span className='search-channel__name'>
{channelDisplayName}
</span>
@ -541,7 +541,7 @@ const PostComponent = (props: Props): JSX.Element => {
/>
</span>
}
{Boolean(isSearchResultItem) && Boolean(props.teamDisplayName) &&
{(Boolean(isSearchResultItem) || props.isFlaggedPosts) && Boolean(props.teamDisplayName) &&
<span className='search-team__name'>
{props.teamDisplayName}
</span>