Skip to content

Commit

Permalink
[MM-53636] Add channel/team name back for the Saved Posts view (matte…
Browse files Browse the repository at this point in the history
…rmost#24117)

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

* E2E test
  • Loading branch information
devinbinnie committed Jul 28, 2023
1 parent 93a2c32 commit 0475839
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions webapp/channels/src/components/post/post_component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit 0475839

Please sign in to comment.