fix(canvas/test): add missing renderToolbar helper to FilesTab.test.tsx #913
@ -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", () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user