import Enzyme from 'enzyme';
import React from 'react';

import { ConsentActionType } from '../../node_modules/@signatu/consent';
import { withDefaultTheme } from '../test/testUtil';
import { DataProcessingGroup } from './dataProcessingGroup';

const testComponent = () => withDefaultTheme(<DataProcessingGroup 
    config={{
        accessToken: "123", 
        apiKey: "123"
    }}
    type={ ConsentActionType.BUTTONS }
    groupId={"123"}
    subject="foo"
    issuer="bar"
/>)

 test('Renders DataProcessingGroup element', async () => {
    const component = Enzyme.mount(testComponent())

    const title = component.find('[data-type="DataProcessingGroup"]')
    expect(title.length).toEqual(1)
    component.unmount()
})
