import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { screen } from '@testing-library/react';
import '../../test/jest/__mock__';
jest.unmock('@folio/stripes/components');
import {
renderWithIntl,
stripesStub,
translationsProperties
} from '../../test/jest/helpers';
import StatisticalCodeSettings from './StatisticalCodeSettings';
const props = {
stripes: {
...stripesStub,
connect: component => component,
},
resources: {
statisticalCodeTypes: {
records: [
{ id: 'statisticalCodeType1', name: 'Statistical Code Type 1', },
{ id: 'statisticalCodeType2', name: 'Statistical Code Type 2', },
],
},
},
};
const StatisticalCodeSettingsSetup = () => (
);
const renderStatisticalCodeSettings = () => renderWithIntl(
,
translationsProperties
);
describe('StatisticalCodeSettings', () => {
it('render', () => {
renderStatisticalCodeSettings();
screen.debug();
});
it('should render properly', () => {
const { getByText } = renderStatisticalCodeSettings();
expect(getByText('ControlledVocab')).toBeInTheDocument();
});
it('should have a defined and frozen manifest', () => {
expect(StatisticalCodeSettings.manifest).toBeDefined();
expect(Object.isFrozen(StatisticalCodeSettings.manifest)).toBe(true);
});
it('should have defined propTypes', () => {
expect(StatisticalCodeSettings.propTypes).toBeDefined();
expect(StatisticalCodeSettings.propTypes.resources).toBeDefined();
expect(StatisticalCodeSettings.propTypes.stripes).toBeDefined();
});
});