test(team): align launch dialog expectations

This commit is contained in:
777genius 2026-05-07 17:27:45 +03:00
parent 9a1b01b2b6
commit 2e05941cba
5 changed files with 19 additions and 38 deletions

View file

@ -34,9 +34,9 @@ export function shouldShowCodexReconnectPrompt({
(provider) => provider.providerId === 'codex'
);
const codexConnection = codexProvider?.connection?.codex;
const loginStatus = codexConnection?.login.status;
const loginStatus = codexConnection?.login?.status;
const loginPending = loginStatus === 'starting' || loginStatus === 'pending';
if (loginPending && codexConnection?.login.authUrl) {
if (loginPending && codexConnection?.login?.authUrl) {
return true;
}

View file

@ -14,14 +14,19 @@ export interface ProjectPathOptionMeta {
}
function toProjectOption(project: ProjectPathProject): ComboboxOption {
return {
const option: ComboboxOption = {
value: project.path,
label: project.name,
description: project.path,
meta: {
discoverySource: project.discoverySource,
} satisfies ProjectPathOptionMeta,
};
if (project.discoverySource !== undefined) {
option.meta = {
discoverySource: project.discoverySource,
} satisfies ProjectPathOptionMeta;
}
return option;
}
/**

View file

@ -40,6 +40,7 @@ vi.mock('@renderer/api', () => ({
createdAt: 1,
},
]),
getDashboardRecentProjects: vi.fn(async () => ({ projects: [] })),
teams: {
getSavedRequest: vi.fn(async () => null),
replaceMembers: vi.fn(async () => {}),

View file

@ -1280,7 +1280,7 @@ describe('team change throttling', () => {
expect(refreshTeamChangePresenceSpy).toHaveBeenCalledWith('my-team');
});
it('polls unknown in-progress tasks in round-robin order without starving later tasks', async () => {
it('keeps background polling disabled for unknown in-progress tasks', async () => {
const invalidateTaskChangePresence = vi.fn();
const checkTaskHasChanges = vi.fn(async () => undefined);
@ -1321,24 +1321,11 @@ describe('team change throttling', () => {
checkTaskHasChanges,
} as never);
await vi.advanceTimersByTimeAsync(10_000);
expect(checkTaskHasChanges).toHaveBeenNthCalledWith(
1,
'my-team',
'task-1',
expect.objectContaining({ status: 'in_progress', owner: 'alice' })
);
await vi.advanceTimersByTimeAsync(10_000);
expect(checkTaskHasChanges).toHaveBeenNthCalledWith(
2,
'my-team',
'task-2',
expect.objectContaining({ status: 'in_progress', owner: 'alice' })
);
await vi.advanceTimersByTimeAsync(20_000);
expect(checkTaskHasChanges).not.toHaveBeenCalled();
});
it('polls visible non-selected graph teams from cached team data', async () => {
it('keeps background polling disabled for visible non-selected graph teams', async () => {
const invalidateTaskChangePresence = vi.fn();
const checkTaskHasChanges = vi.fn(async () => undefined);
@ -1400,21 +1387,8 @@ describe('team change throttling', () => {
checkTaskHasChanges,
} as never);
await vi.advanceTimersByTimeAsync(10_000);
expect(checkTaskHasChanges).toHaveBeenNthCalledWith(
1,
'my-team',
'task-1',
expect.objectContaining({ status: 'in_progress', owner: 'alice' })
);
await vi.advanceTimersByTimeAsync(10_000);
expect(checkTaskHasChanges).toHaveBeenNthCalledWith(
2,
'my-team',
'task-2',
expect.objectContaining({ status: 'in_progress', owner: 'alice' })
);
await vi.advanceTimersByTimeAsync(20_000);
expect(checkTaskHasChanges).not.toHaveBeenCalled();
});
it('per-team throttling: busy team does not block another visible team', async () => {

View file

@ -204,6 +204,7 @@ describe('teamModelAvailability', () => {
expect(getTeamModelSelectionError('codex', 'gpt-5.4', providerStatus)).toBeNull();
expect(getAvailableTeamProviderModelOptions('codex', providerStatus)).toEqual([
{ value: '', label: 'Default', badgeLabel: 'Default' },
{ value: 'gpt-5.5', label: '5.5', badgeLabel: '5.5' },
{ value: 'gpt-5.4', label: '5.4', badgeLabel: '5.4' },
{ value: 'gpt-5.4-mini', label: '5.4 Mini', badgeLabel: '5.4-mini' },
{ value: 'gpt-5.3-codex', label: '5.3 Codex', badgeLabel: '5.3-codex' },