mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-04 16:02:08 +00:00
28 lines
1.2 KiB
TypeScript
28 lines
1.2 KiB
TypeScript
import { createRef } from "react";
|
|
import { screen } from "@testing-library/react";
|
|
import { describe, expect, it, vi } from "vitest";
|
|
import { MediaUploaderDropzone } from "@/app/(protected)/workorders/_components/media/media-uploader-dropzone";
|
|
import { workOrderMediaAcceptAttribute } from "@/domain/work-orders/utils/work-order-media-limits";
|
|
import { renderWithProviders } from "@/test/test-utils";
|
|
|
|
describe("MediaUploaderDropzone", () => {
|
|
it("matches the AAP Photos accept copy and keeps it media-only", () => {
|
|
renderWithProviders(
|
|
<MediaUploaderDropzone
|
|
inputRef={createRef<HTMLInputElement>()}
|
|
pending={false}
|
|
onFilesSelected={vi.fn()}
|
|
/>,
|
|
);
|
|
|
|
expect(
|
|
screen.getByText("Accepted: JPG, PNG, MP4, MOV · Max 50MB per file"),
|
|
).toBeInTheDocument();
|
|
expect(screen.queryByText(/categorize after upload/i)).not.toBeInTheDocument();
|
|
expect(screen.queryByText(/PDF/)).not.toBeInTheDocument();
|
|
expect(screen.queryByText(/DOC/)).not.toBeInTheDocument();
|
|
const input = document.querySelector('input[type="file"]');
|
|
expect(input?.getAttribute("accept")).toBe(workOrderMediaAcceptAttribute());
|
|
expect(input?.getAttribute("accept")).not.toContain(".pdf");
|
|
});
|
|
});
|