This commit is contained in:
@@ -54,4 +54,56 @@ describe('DelegateLiveConsole', () => {
|
||||
expect(screen.getByText('親')).toBeTruthy();
|
||||
expect(screen.getByText('子')).toBeTruthy();
|
||||
});
|
||||
|
||||
// --- Task 8: originJobId によるパーティション ---
|
||||
|
||||
it('originJobId=null の親エントリと originJobId あり のサブタスクエントリを両方描画し、見出しを表示する', () => {
|
||||
const streams: Record<string, DelegateStreamEntry> = {
|
||||
'run-parent': entry({
|
||||
delegateRunId: 'run-parent',
|
||||
description: 'Parent delegate run',
|
||||
text: 'parent text output',
|
||||
originJobId: null,
|
||||
}),
|
||||
'run-sub': entry({
|
||||
delegateRunId: 'run-sub',
|
||||
description: 'Subtask delegate run',
|
||||
text: 'subtask text output',
|
||||
originJobId: 'sub1',
|
||||
}),
|
||||
};
|
||||
renderWithProviders(<DelegateLiveConsole streams={streams} />);
|
||||
expect(screen.getByText('parent text output')).toBeTruthy();
|
||||
expect(screen.getByText('subtask text output')).toBeTruthy();
|
||||
// 'delegateRuns.subtaskSectionHeading' = 'Delegate runs in subtasks'
|
||||
expect(screen.getByText('Delegate runs in subtasks')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('サブタスクエントリが無ければ subtaskSectionHeading を描画しない', () => {
|
||||
const streams: Record<string, DelegateStreamEntry> = {
|
||||
'run-parent': entry({
|
||||
delegateRunId: 'run-parent',
|
||||
description: 'Only parent run',
|
||||
text: 'parent only',
|
||||
originJobId: null,
|
||||
}),
|
||||
};
|
||||
renderWithProviders(<DelegateLiveConsole streams={streams} />);
|
||||
expect(screen.getByText('parent only')).toBeTruthy();
|
||||
expect(screen.queryByText('Delegate runs in subtasks')).toBeNull();
|
||||
});
|
||||
|
||||
it('サブタスクのみの場合も subtaskSectionHeading を表示する', () => {
|
||||
const streams: Record<string, DelegateStreamEntry> = {
|
||||
'run-sub-only': entry({
|
||||
delegateRunId: 'run-sub-only',
|
||||
description: 'Sub only run',
|
||||
text: 'sub only text',
|
||||
originJobId: 'job42',
|
||||
}),
|
||||
};
|
||||
renderWithProviders(<DelegateLiveConsole streams={streams} />);
|
||||
expect(screen.getByText('sub only text')).toBeTruthy();
|
||||
expect(screen.getByText('Delegate runs in subtasks')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user