feat: organize project conversations and add coding teacher side chat
This commit is contained in:
@@ -306,3 +306,21 @@ describe('coding workspace store', () => {
|
||||
expect(store.getState().conversationErrorsByProjectId[secondProject.id]).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps the newer project visible when an earlier activation finishes late', async () => {
|
||||
const second = {...project,id:'project-2',name:'Second'};
|
||||
const delayed = deferred<CodingProjectSummary>();
|
||||
let active = project.id;
|
||||
const store = createCodingWorkspaceStore({
|
||||
listProjects: async () => ({projects:[project,second],activeProjectId:active}),
|
||||
getConfig: async (id) => ({project:id===project.id?project:second,config:config([agent('default')])}),
|
||||
listConversations: async id => [conversation(id+'-chat','default')],
|
||||
setActiveProject: async id => {if(id===project.id)return delayed.promise;active=id;return second;},
|
||||
});
|
||||
await store.getState().load();
|
||||
const old = store.getState().setActiveProject(project.id);
|
||||
const latest = store.getState().setActiveProject(second.id);
|
||||
delayed.resolve(project);await Promise.all([old, latest]);
|
||||
expect(store.getState().activeProjectId).toBe(second.id);
|
||||
expect(store.getState().conversations[0].id).toBe('project-2-chat');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user