fix(canvas/test): add missing renderToolbar helper to FilesTab.test.tsx #913

Merged
devops-engineer merged 1 commits from fix/files-tab-test-missing-helper into main 2026-05-14 01:28:08 +00:00

View File

@ -12,6 +12,7 @@ import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/re
import React from "react";
import { FilesTab } from "../../FilesTab.tsx";
import { FilesToolbar } from "../FilesToolbar.tsx";
import type { FileEntry } from "../../FilesTab/tree";
// ─── Mock ──────────────────────────────────────────────────────────────────
@ -41,6 +42,23 @@ function renderPlatformTab(extraProps: Partial<React.ComponentProps<typeof Files
);
}
/** Render FilesToolbar directly with stub handlers. */
function renderToolbar(extraProps: Partial<React.ComponentProps<typeof FilesToolbar>> = {}) {
return render(
<FilesToolbar
root="/configs"
setRoot={vi.fn()}
fileCount={0}
onNewFile={vi.fn()}
onUpload={vi.fn()}
onDownloadAll={vi.fn()}
onClearAll={vi.fn()}
onRefresh={vi.fn()}
{...extraProps}
/>
);
}
// ─── NotAvailablePanel ──────────────────────────────────────────────────────
describe("FilesTab — NotAvailablePanel", () => {