* feat: update display preview panel * chore: update package * test: update unit testing * test: update test * test: update unit testing * feat: update preview display to use custom renderer * chore: use worker for react-pdf * test: update unit testing * chore: update requested change * chore: update gitignore for sample files * fix: hard-code filetype mappings * fix: make integration test work again * chore: update tests * feat: add FileInfo to preview cards Co-authored-by: Leangseu Kim <lkim@edx.org>
26 lines
750 B
JavaScript
26 lines
750 B
JavaScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
|
|
import { Popover } from '@edx/paragon';
|
|
|
|
import FileInfo from './FileInfo';
|
|
|
|
describe('File Preview Card component', () => {
|
|
const children = (<h1>some Children</h1>);
|
|
const props = { onClick: jest.fn().mockName('this.props.onClick') };
|
|
let el;
|
|
beforeEach(() => {
|
|
el = shallow(<FileInfo {...props}>{children}</FileInfo>);
|
|
});
|
|
test('snapshot', () => {
|
|
expect(el).toMatchSnapshot();
|
|
});
|
|
describe('Component', () => {
|
|
test('overlay with passed children', () => {
|
|
const { overlay } = el.at(0).props();
|
|
expect(overlay.type).toEqual(Popover);
|
|
expect(overlay.props.children).toEqual(<Popover.Content>{children}</Popover.Content>);
|
|
});
|
|
});
|
|
});
|