MM-64681 Fix in: filter in mobile search box (#32120)

Этот коммит содержится в:
Harrison Healey
2025-07-08 14:45:28 -04:00
коммит произвёл GitHub
родитель ad38971dd6
Коммит 30ba6f573d
3 изменённых файлов: 40 добавлений и 3 удалений

Просмотреть файл

@@ -79,4 +79,38 @@ describe('Mobile Search', () => {
// * Verify that the loading spinner is eventually gone // * Verify that the loading spinner is eventually gone
verifyLoadingSpinnerIsGone(); verifyLoadingSpinnerIsGone();
}); });
it('MM-64681 should be able to autocomplete users and channels in mobile view', () => {
// * Open the search box
cy.get('button.navbar-search').click();
// * Verify that the search box is open
cy.get('#sbrSearchBox').should('be.visible');
// # Trigger the user autocomplete to appear
cy.get('#sbrSearchBox').type('from:');
// * Verify that the autocomplete is visible and contains some result
cy.get('[role="listbox"]').get('[role="option"]').should('be.visible').and('contain.text', 'sysadmin');
// # Select a user
cy.get('[role="option"]').contains('sysadmin').click();
// * Verify that the autocomplete closed and the user's name was added to the result
cy.get('[role="listbox"]').should('not.exist');
cy.get('#sbrSearchBox').should('have.value', 'from:sysadmin ');
// # Trigger the channel autocomplete to appear
cy.get('#sbrSearchBox').type('in:');
// * Verify that the autocomplete is visible and contains some results
cy.get('[role="listbox"]').get('[role="option"]').should('be.visible');
// # Select a channel
cy.get('[role="option"]').contains('Off-Topic').click();
// * Verify that the autocomplete closed and the Off-Topic channel was selected was added to the result
cy.get('[role="listbox"]').should('not.exist');
cy.get('#sbrSearchBox').should('have.value', 'from:sysadmin in:off-topic ');
});
}); });

Просмотреть файл

@@ -67,8 +67,8 @@ function mapStateToProps(state: GlobalState) {
} }
function mapDispatchToProps(dispatch: Dispatch) { function mapDispatchToProps(dispatch: Dispatch) {
const autocompleteChannels = (term: string, teamId: string, success?: (channels: Channel[]) => void, error?: (err: ServerError) => void): void => { const autocompleteChannels = (term: string, teamId: string, success?: (channels: Channel[]) => void, error?: (err: ServerError) => void) => {
autocompleteChannelsForSearch(term, success, error); return autocompleteChannelsForSearch(term, success, error);
}; };
return { return {

Просмотреть файл

@@ -114,7 +114,10 @@ export default class SearchSuggestionList extends SuggestionList {
className='search-help-popover autocomplete visible' className='search-help-popover autocomplete visible'
placement='bottom' placement='bottom'
> >
<div ref={this.itemsContainerRef}> <div
ref={this.itemsContainerRef}
role='listbox'
>
{items} {items}
</div> </div>
</Popover> </Popover>