Skip to content

Commit

Permalink
chore(FileDropZone): Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccaalpert committed Oct 19, 2024
1 parent a91e7e6 commit 0b8f9e7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/module/src/FileDropZone/FileDropZone.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import FileDropZone from './FileDropZone';

describe('FileDropZone', () => {
it('should render file drop zone', () => {
const { container } = render(<FileDropZone onFileDrop={jest.fn()} />);
expect(container).toMatchSnapshot();
});
it('should render children', () => {
render(<FileDropZone onFileDrop={jest.fn()}>Hi</FileDropZone>);
expect(screen.getByText('Hi')).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`FileDropZone should render file drop zone 1`] = `
<div>
<div
class="pf-v6-c-multiple-file-upload pf-chatbot__dropzone pf-chatbot__dropzone--default pf-chatbot__dropzone--invisible "
role="presentation"
tabindex="0"
>
<input
multiple=""
style="display: none;"
tabindex="-1"
type="file"
/>
</div>
</div>
`;

0 comments on commit 0b8f9e7

Please sign in to comment.