ClusterStatusIcon.spec.tsx 840 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import { mount } from 'enzyme';
  3. import { ServerStatus } from 'generated-sources';
  4. import ClusterStatusIcon from 'components/Nav/ClusterStatusIcon';
  5. describe('ClusterStatusIcon', () => {
  6. it('matches snapshot', () => {
  7. const wrapper = mount(<ClusterStatusIcon status={ServerStatus.ONLINE} />);
  8. expect(wrapper).toMatchSnapshot();
  9. });
  10. it('renders online icon', () => {
  11. const wrapper = mount(<ClusterStatusIcon status={ServerStatus.ONLINE} />);
  12. expect(wrapper.exists('.is-success')).toBeTruthy();
  13. expect(wrapper.exists('.is-danger')).toBeFalsy();
  14. });
  15. it('renders offline icon', () => {
  16. const wrapper = mount(<ClusterStatusIcon status={ServerStatus.OFFLINE} />);
  17. expect(wrapper.exists('.is-danger')).toBeTruthy();
  18. expect(wrapper.exists('.is-success')).toBeFalsy();
  19. });
  20. });