fix: add missing log mock to provider test fixtures for reopenParentFromDelegation

This commit is contained in:
Roo Code 2026-05-12 08:00:37 +00:00
parent d74971acfe
commit ed8b991432
2 changed files with 11 additions and 0 deletions

View file

@ -73,6 +73,7 @@ describe("History resume delegation - parent metadata transitions", () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId,
emit: providerEmit,
getCurrentTask: vi.fn(() => ({ taskId: "child-1" })),
@ -122,6 +123,7 @@ describe("History resume delegation - parent metadata transitions", () => {
it("reopenParentFromDelegation injects subtask_result into both UI and API histories", async () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/storage" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockResolvedValue({
historyItem: {
id: "p1",
@ -205,6 +207,7 @@ describe("History resume delegation - parent metadata transitions", () => {
it("reopenParentFromDelegation injects tool_result when new_task tool_use exists in API history", async () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/storage" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockResolvedValue({
historyItem: {
id: "p-tool",
@ -291,6 +294,7 @@ describe("History resume delegation - parent metadata transitions", () => {
it("reopenParentFromDelegation injects plain text when no new_task tool_use exists in API history", async () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/storage" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockResolvedValue({
historyItem: {
id: "p-no-tool",
@ -351,6 +355,7 @@ describe("History resume delegation - parent metadata transitions", () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockResolvedValue({
historyItem: {
id: "parent-2",
@ -391,6 +396,7 @@ describe("History resume delegation - parent metadata transitions", () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockResolvedValue({
historyItem: {
id: "p3",
@ -457,6 +463,7 @@ describe("History resume delegation - parent metadata transitions", () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockImplementation(async (id: string) => {
if (id === "parent-rpd06") {
return {
@ -527,6 +534,7 @@ describe("History resume delegation - parent metadata transitions", () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockResolvedValue({
historyItem: {
id: "p4",
@ -580,6 +588,7 @@ describe("History resume delegation - parent metadata transitions", () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockImplementation(async (id: string) => {
if (id === "parent-rpd02") {
return {
@ -726,6 +735,7 @@ describe("History resume delegation - parent metadata transitions", () => {
it("handles empty history gracefully when injecting synthetic messages", async () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId: vi.fn().mockResolvedValue({
historyItem: {
id: "p5",

View file

@ -138,6 +138,7 @@ describe("Nested delegation resume (A → B → C)", () => {
const provider = {
contextProxy: { globalStorageUri: { fsPath: "/tmp" } },
log: vi.fn(),
getTaskWithId,
emit: emitSpy,
getCurrentTask: vi.fn(() => (currentActiveId ? ({ taskId: currentActiveId } as any) : undefined)),