Update Upload form tests with mocked provider
This commit is contained in:
21
src/components/contexts/__mocks__/FileUploadContext.jsx
Normal file
21
src/components/contexts/__mocks__/FileUploadContext.jsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import React from "react";
|
||||
|
||||
let uploading = false;
|
||||
let progress = 0;
|
||||
let status = null;
|
||||
|
||||
export const FileUploadProvider = ({ children }) => {
|
||||
return (
|
||||
<div data-testid="mocked-fileuploadprovider">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const useFileUploadContext = () => ({
|
||||
uploading,
|
||||
progress,
|
||||
status,
|
||||
upload: jest.fn(),
|
||||
cancel: jest.fn(),
|
||||
});
|
||||
Reference in New Issue
Block a user