import React from 'react';
import CustomDialog from '../CustomDialog';
import { render } from 'enzyme';
import DialogTitle from '@material-ui/core/DialogTitle';
import Icon from '@material-ui/core/Icon';
import Typography from '@material-ui/core/Typography';
import DialogContent from '@material-ui/core/DialogContent';
import DialogActions from '@material-ui/core/DialogActions';
import Button from '@material-ui/core/Button';

HTMLCanvasElement.prototype.getContext = () => {
    // return whatever getContext has to return
};
describe('Shared/Components/CustomDialog', () => {
    it('renders correctly', () => {
        const tree = render(
            <CustomDialog open={true}>
                <DialogTitle>
                    <b>Test</b>
                    <Icon>close</Icon>
                </DialogTitle>
                <DialogContent>
                    <Typography variant="body1">Test Content</Typography>
                </DialogContent>
                <DialogActions>
                    <Button value="Test" />
                </DialogActions>
            </CustomDialog>
        );
        expect(tree).toMatchSnapshot();
    });
});
