import * as React from 'react';
import { shallow } from 'enzyme';
import { EmptyState, Title } from '@patternfly/react-core';

import { GraphEmpty } from '@console/internal/components/graphs/graph-empty';
import { LoadingBox } from '@console/internal/components/utils';

describe('<GraphEmpty />', () => {
  it('should render a loading state', () => {
    const wrapper = shallow(<GraphEmpty loading />);
    expect(wrapper.find(LoadingBox).exists()).toBe(true);
  });

  it('should render an empty state', () => {
    const wrapper = shallow(<GraphEmpty />);
    expect(wrapper.find(EmptyState).exists()).toBe(true);
    expect(wrapper.find(Title).exists()).toBe(true);
  });
});
