import { render } from 'enzyme';
import ToolbarList from './index';
import React from 'react';
import { createMuiTheme, MuiThemeProvider } from '@material-ui/core';

const tools = [
    {
        key: 'save',
        identifier: 'save',
        function: 'saveConfiguration',
    },
    {
        key: 'mail',
        identifier: 'mail',
        function: 'sendMail',
    },
    {
        key: 'picture_as_pdf',
        identifier: 'picture_as_pdf',
        function: 'savePDf',
    },
    {
        key: 'help',
        identifier: 'help',
        function: 'help',
    },
];

describe('Shared/Components/ToolbarList', () => {
    test('the rendered component contains the custom-css-tools class', () => {
        const theme = createMuiTheme({ props: { MuiWithWidth: { initialWidth: 'lg' } } });
        const tree = render(
            <MuiThemeProvider theme={theme}>
                <ToolbarList tools={tools} />
            </MuiThemeProvider>
        );
        expect(tree).toMatchSnapshot();
    });
});
