Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4003,7 +4003,7 @@ suite('Sessions - SessionsList', () => {
readonly sortChanges: readonly ISortChangeRecord[];
}

function renderGroupedList(sessions: ISession[], memberships: Map<string, string>, groupExternalSessions = false, grouping = SessionsGrouping.Workspace): IDropHarness {
function renderGroupedList(sessions: ISession[], memberships: Map<string, string>, groupExternalSessions = false, grouping = SessionsGrouping.Workspace, supportsQuickChats = false): IDropHarness {
const removedFromGroup: string[] = [];
const onDidChange = disposables.add(new Emitter<ISessionGroupsChangeEvent>());
const harness = createListHarness(disposables, sessions, instantiationService => {
Expand All @@ -4024,6 +4024,15 @@ suite('Sessions - SessionsList', () => {
onDidChange.fire({ groupsChanged: false, membershipChanged: new Set([sessionId]) });
}
});
if (supportsQuickChats) {
void (instantiationService.get(IConfigurationService) as TestConfigurationService).setUserConfiguration(SESSIONS_LIST_SHOW_EMPTY_DEFAULT_GROUPS_SETTING, true);
const quickChatProvider = upcastPartial<ISessionsProvider>({ supportsQuickChats: true });
instantiationService.stub(ISessionsProvidersService, new class extends mock<ISessionsProvidersService>() {
override readonly onDidChangeProviders = Event.None;
override getProviders() { return [quickChatProvider]; }
override getProvider() { return undefined; }
});
}
});
const container = harness.createContainer();
const list = harness.store.add(harness.instantiationService.createInstance(SessionsList, container, {
Expand Down Expand Up @@ -4166,6 +4175,20 @@ suite('Sessions - SessionsList', () => {
reordered: 0,
});
});

test('returns the only quick chat to the empty Chats section', () => {
const groupedChat = createTestSession('GroupedChat', { isQuickChat: true }).session;
const regular = createTestSession('Regular').session;
const memberships = new Map([[groupedChat.sessionId, group.id]]);
const { container, removedFromGroup } = renderGroupedList([groupedChat, regular], memberships, false, SessionsGrouping.Date, true);

const chatOntoChats = drag(sessionRow(container, 'GroupedChat'), sectionRow(container, 'Chats'), container);

assert.deepStrictEqual({ chatOntoChats, removedFromGroup }, {
chatOntoChats: ['Chats'],
removedFromGroup: ['GroupedChat'],
});
});
});

suite('moving between placements', () => {
Expand Down
Loading