modelTrajectoryPane.test.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { createElement } from "react";
  2. import { renderToStaticMarkup } from "react-dom/server";
  3. import { describe, expect, it, vi } from "vitest";
  4. vi.mock("@/hooks/useModelTrajectory.js", () => ({
  5. useModelTrajectory: () => ({
  6. data: null,
  7. error: null,
  8. loading: false,
  9. refresh: vi.fn(),
  10. }),
  11. }));
  12. vi.mock("@/hooks/usePlatform.js", () => ({
  13. usePlatform: () => ({ openInFileManager: vi.fn() }),
  14. }));
  15. vi.mock("@/i18n/IntlProvider.js", () => ({
  16. useZCodeIntl: () => ({
  17. intl: {
  18. formatMessage: ({ id }: { id: string }) => id,
  19. },
  20. }),
  21. }));
  22. import { ModelTrajectoryPane } from "@/ModelTrajectoryPane.js";
  23. describe("ModelTrajectoryPane", () => {
  24. it("uses a native overflow container for the trajectory content", () => {
  25. const html = renderToStaticMarkup(
  26. createElement(ModelTrajectoryPane, {
  27. taskId: "task-1",
  28. workspacePath: "/repo",
  29. }),
  30. );
  31. expect(html).toContain("min-h-0 flex-1 overflow-x-hidden overflow-y-auto");
  32. expect(html).not.toContain('data-slot="scroll-area"');
  33. });
  34. });