import { ReactBase, baseUniDriverFactory } from '../utils/test-utils/unidriver';
import { dataHooks } from './constants';
const dataTransferFromFiles = files => ({
    files,
    items: files.map(f => ({
        kind: 'file',
        type: f.type,
        getAsFile: () => f,
    })),
    types: ['Files'],
});
export const dropzoneDriverFactory = (base, body) => {
    return {
        ...baseUniDriverFactory(base, body),
        /** Returns the content compound element inside the dropzone. */
        getContentElement: () => base.$(`[data-hook=${dataHooks.dropzoneContent}]`),
        /** Returns the overlay compound element inside the dropzone. */
        getOverlayElement: () => base.$(`[data-hook=${dataHooks.dropzoneOverlay}]`),
        /** fires a drop event with the given files. */
        dropFiles: async (files) => ReactBase(base).drop({
            dataTransfer: dataTransferFromFiles(files),
        }),
    };
};
//# sourceMappingURL=Dropzone.uni.driver.js.map