test(team): align launch dialog expectations
This commit is contained in:
parent
9a1b01b2b6
commit
2e05941cba
5 changed files with 19 additions and 38 deletions
|
|
@ -34,9 +34,9 @@ export function shouldShowCodexReconnectPrompt({
|
||||||
(provider) => provider.providerId === 'codex'
|
(provider) => provider.providerId === 'codex'
|
||||||
);
|
);
|
||||||
const codexConnection = codexProvider?.connection?.codex;
|
const codexConnection = codexProvider?.connection?.codex;
|
||||||
const loginStatus = codexConnection?.login.status;
|
const loginStatus = codexConnection?.login?.status;
|
||||||
const loginPending = loginStatus === 'starting' || loginStatus === 'pending';
|
const loginPending = loginStatus === 'starting' || loginStatus === 'pending';
|
||||||
if (loginPending && codexConnection?.login.authUrl) {
|
if (loginPending && codexConnection?.login?.authUrl) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,19 @@ export interface ProjectPathOptionMeta {
|
||||||
}
|
}
|
||||||
|
|
||||||
function toProjectOption(project: ProjectPathProject): ComboboxOption {
|
function toProjectOption(project: ProjectPathProject): ComboboxOption {
|
||||||
return {
|
const option: ComboboxOption = {
|
||||||
value: project.path,
|
value: project.path,
|
||||||
label: project.name,
|
label: project.name,
|
||||||
description: project.path,
|
description: project.path,
|
||||||
meta: {
|
|
||||||
discoverySource: project.discoverySource,
|
|
||||||
} satisfies ProjectPathOptionMeta,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (project.discoverySource !== undefined) {
|
||||||
|
option.meta = {
|
||||||
|
discoverySource: project.discoverySource,
|
||||||
|
} satisfies ProjectPathOptionMeta;
|
||||||
|
}
|
||||||
|
|
||||||
|
return option;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ vi.mock('@renderer/api', () => ({
|
||||||
createdAt: 1,
|
createdAt: 1,
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
|
getDashboardRecentProjects: vi.fn(async () => ({ projects: [] })),
|
||||||
teams: {
|
teams: {
|
||||||
getSavedRequest: vi.fn(async () => null),
|
getSavedRequest: vi.fn(async () => null),
|
||||||
replaceMembers: vi.fn(async () => {}),
|
replaceMembers: vi.fn(async () => {}),
|
||||||
|
|
|
||||||
|
|
@ -1280,7 +1280,7 @@ describe('team change throttling', () => {
|
||||||
expect(refreshTeamChangePresenceSpy).toHaveBeenCalledWith('my-team');
|
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 invalidateTaskChangePresence = vi.fn();
|
||||||
const checkTaskHasChanges = vi.fn(async () => undefined);
|
const checkTaskHasChanges = vi.fn(async () => undefined);
|
||||||
|
|
||||||
|
|
@ -1321,24 +1321,11 @@ describe('team change throttling', () => {
|
||||||
checkTaskHasChanges,
|
checkTaskHasChanges,
|
||||||
} as never);
|
} as never);
|
||||||
|
|
||||||
await vi.advanceTimersByTimeAsync(10_000);
|
await vi.advanceTimersByTimeAsync(20_000);
|
||||||
expect(checkTaskHasChanges).toHaveBeenNthCalledWith(
|
expect(checkTaskHasChanges).not.toHaveBeenCalled();
|
||||||
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' })
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
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 invalidateTaskChangePresence = vi.fn();
|
||||||
const checkTaskHasChanges = vi.fn(async () => undefined);
|
const checkTaskHasChanges = vi.fn(async () => undefined);
|
||||||
|
|
||||||
|
|
@ -1400,21 +1387,8 @@ describe('team change throttling', () => {
|
||||||
checkTaskHasChanges,
|
checkTaskHasChanges,
|
||||||
} as never);
|
} as never);
|
||||||
|
|
||||||
await vi.advanceTimersByTimeAsync(10_000);
|
await vi.advanceTimersByTimeAsync(20_000);
|
||||||
expect(checkTaskHasChanges).toHaveBeenNthCalledWith(
|
expect(checkTaskHasChanges).not.toHaveBeenCalled();
|
||||||
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' })
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('per-team throttling: busy team does not block another visible team', async () => {
|
it('per-team throttling: busy team does not block another visible team', async () => {
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,7 @@ describe('teamModelAvailability', () => {
|
||||||
expect(getTeamModelSelectionError('codex', 'gpt-5.4', providerStatus)).toBeNull();
|
expect(getTeamModelSelectionError('codex', 'gpt-5.4', providerStatus)).toBeNull();
|
||||||
expect(getAvailableTeamProviderModelOptions('codex', providerStatus)).toEqual([
|
expect(getAvailableTeamProviderModelOptions('codex', providerStatus)).toEqual([
|
||||||
{ value: '', label: 'Default', badgeLabel: 'Default' },
|
{ 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', label: '5.4', badgeLabel: '5.4' },
|
||||||
{ value: 'gpt-5.4-mini', label: '5.4 Mini', badgeLabel: '5.4-mini' },
|
{ 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' },
|
{ value: 'gpt-5.3-codex', label: '5.3 Codex', badgeLabel: '5.3-codex' },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue