Fix: Channels header disappears in Find Channels dialog during search (#35202)

The "Channels" header was flashing and then disappearing when typing in
the Find Channels dialog (Ctrl/Cmd+K). This was caused by the
fetchUsersAndChannels method returning results without the groups
structure that was introduced in MM-62990.
This commit is contained in:
Scott Bishel
2026-02-19 08:41:41 -07:00
committed by GitHub
parent c45ba96139
commit 8309cb6a07
2 changed files with 37 additions and 8 deletions
@@ -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,
}),
]),
}));
});
@@ -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,
}],
});
}