import React from 'react';
import { render } from '@testing-library/react';
import { RecommendedFetch } from '../RecommendedFetch';
jest.mock('../RecommendedArticles', () => ({
RecommendedArticles: (props: any) => (
RecommendedArticles
{props.heading}
)
}));
jest.mock('../../../helpers/fetch/FetchProvider', () => ({
FetchProvider: (props: any) => (
FetchProvider
{props.children}
)
}));
describe('', () => {
beforeEach(() => {
window.nuk = { getCookieValue: () => true };
window.__TIMES_CONFIG__ = { environmentName: 'local-prod' };
});
it('should render headers in lowercase correctly', () => {
const { asFragment, getByText } = render(
);
expect(getByText('FetchProvider'));
expect(getByText('RecommendedArticles'));
expect(getByText('Read more'));
expect(asFragment()).toMatchSnapshot();
});
it('should render an uppercase section name for Scotland', () => {
const { getByText } = render(
);
expect(getByText('Read more'));
});
it('should render an uppercase section name for Ireland', () => {
const { getByText } = render(
);
expect(getByText('Read more'));
});
});