import { shallow } from 'enzyme';
import * as React from 'react';

import { AppVersion } from './app-version';

describe('MenuOption', () => {
  it('should match the snapshot', () => {
    const wrapper = shallow(
      <AppVersion build="testBuild" revision="restRevision" version="testVersion" />,
    );
    expect(wrapper).toMatchSnapshot();
    expect(wrapper.find({ testID: 'backendText' })).toHaveLength(0);
  });

  it('should display current backend', () => {
    const wrapper = shallow(
      <AppVersion
        backend="production"
        build="testBuild"
        revision="restRevision"
        version="testVersion"
      />,
    );
    expect(wrapper.find({ testID: 'backendText' })).toBeTruthy();
  });
});
