diff --git a/webapp/channels/src/components/suggestion/switch_channel_provider.test.tsx b/webapp/channels/src/components/suggestion/switch_channel_provider.test.tsx index aaaa2896206..e89e93ff8c6 100644 --- a/webapp/channels/src/components/suggestion/switch_channel_provider.test.tsx +++ b/webapp/channels/src/components/suggestion/switch_channel_provider.test.tsx @@ -587,7 +587,12 @@ describe('components/SwitchChannelProvider', () => { ]; expect(resultsCallback).toHaveBeenCalledWith(expect.objectContaining({ - terms: expectedOrder, + groups: expect.arrayContaining([ + expect.objectContaining({ + key: 'channels', + terms: expectedOrder, + }), + ]), })); }); @@ -670,7 +675,12 @@ describe('components/SwitchChannelProvider', () => { ]; expect(resultsCallback).toHaveBeenCalledWith(expect.objectContaining({ - terms: expectedOrder, + groups: expect.arrayContaining([ + expect.objectContaining({ + key: 'channels', + terms: expectedOrder, + }), + ]), })); }); @@ -757,7 +767,12 @@ describe('components/SwitchChannelProvider', () => { 'channel_other_user1', ]; expect(resultsCallback).toHaveBeenCalledWith(expect.objectContaining({ - terms: expectedOrder, + groups: expect.arrayContaining([ + expect.objectContaining({ + key: 'channels', + terms: expectedOrder, + }), + ]), })); }); @@ -906,7 +921,12 @@ describe('components/SwitchChannelProvider', () => { ]; expect(resultsCallback).toHaveBeenCalledWith(expect.objectContaining({ - terms: channelsFromActiveTeams, + groups: expect.arrayContaining([ + expect.objectContaining({ + key: 'channels', + terms: channelsFromActiveTeams, + }), + ]), })); }); @@ -992,7 +1012,12 @@ describe('components/SwitchChannelProvider', () => { ]; expect(resultsCallback).toHaveBeenCalledWith(expect.objectContaining({ - terms: expectedOrder, + groups: expect.arrayContaining([ + expect.objectContaining({ + key: 'channels', + terms: expectedOrder, + }), + ]), })); }); diff --git a/webapp/channels/src/components/suggestion/switch_channel_provider.tsx b/webapp/channels/src/components/suggestion/switch_channel_provider.tsx index 771d5d090f7..619f0656155 100644 --- a/webapp/channels/src/components/suggestion/switch_channel_provider.tsx +++ b/webapp/channels/src/components/suggestion/switch_channel_provider.tsx @@ -655,9 +655,13 @@ export default class SwitchChannelProvider extends Provider { resultsCallback({ matchedPretext: channelPrefix, - items: combinedItems, - terms: combinedTerms, - component: ConnectedSwitchChannelSuggestion, + groups: [{ + key: 'channels', + label: defineMessage({id: 'suggestion.channels', defaultMessage: 'Channels'}), + items: combinedItems, + terms: combinedTerms, + component: ConnectedSwitchChannelSuggestion, + }], }); }