/* eslint-disable no-unused-expressions */
import React from 'react';
import { render, cleanup } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import Disclaimer from '.';

describe('Disclaimer Component', () => {
  test('render disclaimer badge', () => {
    // eslint-disable-next-line global-require
    const func = require('../../../helpers/device-detect');
    func.isNativeImageLazyLoadingSupported = jest.fn(() => true);
    const { container } = render(<Disclaimer dmcaImage="../../../../../images/dmca.png" />);
    expect(container.querySelector('img')).toBeTruthy();
    expect(container.querySelector('img')).toHaveAttribute('src', '../../../../../images/dmca.png');
    expect(container.querySelector('img')).toHaveAttribute('loading', 'eager');
  });
});
afterEach(() => {
  cleanup();
});
