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

import { withDefaultTheme } from '../test/testUtil';
import { CookieBanner } from './cookieBanner';

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

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

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