"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var react_2 = require("@testing-library/react");
var TargetBox_1 = require("./TargetBox");
var mockOnAppendFile = jest.fn();
var setUp = function () {
    return (0, react_2.render)(react_1.default.createElement(TargetBox_1.TargetBox, { onAppendFile: mockOnAppendFile }));
};
describe('TargetBox', function () {
    afterEach(function () {
        jest.clearAllMocks();
    });
    it('should render correctly', function () {
        setUp();
        expect(react_2.screen.getByText('Drag an image here')).toBeInTheDocument();
        expect(react_2.screen.getByRole('button', { name: 'Drop files here' })).toBeInTheDocument();
    });
    it('should call onAppendFile when file is dropped', function () {
        var file = new File(['test content'], 'test.png', { type: 'image/png' });
        setUp();
        var dropZone = react_2.screen.getByRole('button', { name: 'Drop files here' });
        react_2.fireEvent.drop(dropZone, {
            dataTransfer: {
                files: [file],
                types: ['Files']
            }
        });
        expect(mockOnAppendFile).toHaveBeenCalledWith(file);
    });
});
