import Enzyme from 'enzyme';
import { DataProcessingSpec } from './dataProcessingSpec';
import React from 'react';

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

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

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

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