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

import { withDefaultTheme } from '../test/testUtil';
import { ConsentAction } from './consentAction';

const testComponent = (language = 'en') => withDefaultTheme(<ConsentAction
    config={{
        accessToken: "123", 
        apiKey: "123"
    }}
    subject="foo"
    issuer="bar"
    target="baz"
    
    language={language}
/>)

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

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