ExplorerTree.test.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { screen } from "@testing-library/react";
  2. import { renderWithProviders } from "test-utils";
  3. import { describe, afterEach, vi, it, expect } from "vitest";
  4. import ExplorerTree from "#/components/file-explorer/ExplorerTree";
  5. const FILES = ["file-1-1.ts", "folder-1-2"];
  6. describe.skip("ExplorerTree", () => {
  7. afterEach(() => {
  8. vi.resetAllMocks();
  9. });
  10. it("should render the explorer", () => {
  11. renderWithProviders(<ExplorerTree files={FILES} defaultOpen />);
  12. expect(screen.getByText("file-1-1.ts")).toBeInTheDocument();
  13. expect(screen.getByText("folder-1-2")).toBeInTheDocument();
  14. // TODO: make sure children render
  15. });
  16. it("should render the explorer given the defaultExpanded prop", () => {
  17. renderWithProviders(<ExplorerTree files={FILES} />);
  18. expect(screen.queryByText("file-1-1.ts")).toBeInTheDocument();
  19. expect(screen.queryByText("folder-1-2")).toBeInTheDocument();
  20. // TODO: make sure children don't render
  21. });
  22. it.todo("should render all children as collapsed when defaultOpen is false");
  23. it.todo(
  24. "should maintain the expanded state of child folders when closing and opening a parent folder",
  25. );
  26. });