Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
codyzu committed Jul 25, 2023
1 parent 47502ea commit 83db620
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions __mocks__/firebase/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ export async function uploadBytes(
data: Blob | Uint8Array | ArrayBuffer,
metadata?: UploadMetadata | undefined,
) {
console.log('MOCK STORAGE');
const dataForStorage = data instanceof MagicFile ? data.getBuffer() : data;
console.log('Is instanceof MagicFile:', data instanceof MagicFile);
console.log('Incoming data:', data);
console.log('Outgoing data:', dataForStorage);
return uploadBytesOriginal(
ref,
// Firebase/storage expects a Buffer when running in node (i.e. tests)
Expand Down
2 changes: 0 additions & 2 deletions src/components/pdf/__mocks__/Pdf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ export default function Pdf({
const dataUri = useMemo(() => (file as MagicFile).getDataUri(), [file]);
const onPageRenderedMockedToBlob = useCallback(
(canvas: HTMLCanvasElement) => {
console.log('CANVAS MOCK', pageIndex, pages);
// The mocked canvas toBlob doesn't do anything by default
// In our tests, we will call the callback with pre-rendered page image
vi.mocked(canvas.toBlob).mockImplementation((callback: BlobCallback) => {
console.log('CANVAS MOCK CALLING CALLBACK', pageIndex, pages);
callback(pages[pageIndex] as unknown as Blob);
});
onPageRendered(canvas);
Expand Down

0 comments on commit 83db620

Please sign in to comment.