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

import { withDefaultTheme } from '../test/testUtil';
import { ConsentCheckbox } from './consentCheckbox';

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

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

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