message: Update unit test for ContainerRow on Pod page
diff: @@ -49,58 +49,64 @@ describe(PodsDetailsPage.displayName, () => {
  });
  });
  -describe('Renders ContainerRow', () => {
  +describe('ContainerRow', () => {
  + let startTime;
  + let finishTime;
  let pod;
  let container;
  let wrapper: ShallowWrapper;
  - beforeEach(() => {
  + beforeAll(() => {
  + startTime = Date.now();
  + finishTime = Date.now() + 1;
  pod = {
  status: {
  conditions: [],
  - containerStatuses: [],
  + containerStatuses: [
  + {
  + 'name': 'hello-openshift',
  + 'state': {
  + 'running': {
  + 'startedAt': {startTime},
  + 'finishedAt': {finishTime},
  + },
  + },
  + 'restartCount': 10,
  + },
  + ],
  },
  };
  container = {
  name: 'hello-openshift',
  image: 'aosqe/hello-openshift',
  };
  + wrapper = shallow(<ContainerRow pod={pod} container={container} />);
  });
  - it('renders container Name in row', () => {
  - wrapper = shallow(<ContainerRow pod={pod} container={container} />);
  + it('renders the container link', () => {
  expect(wrapper.find('ContainerLink').find({name: 'hello-openshift'}).exists()).toBe(true);
  });
  - it('renders container Image in row', () => {
  - wrapper = shallow(<ContainerRow pod={pod} container={container} />);
  - expect(wrapper.find('div').find({className: 'col-lg-2 col-md-3 col-sm-5 col-xs-7 co-truncate co-nowrap co-select-to-copy'}).text()).toContain('aosqe/hello-openshift');
  + it('renders the container image', () => {
  + expect(wrapper.childAt(1).text()).toContain('aosqe/hello-openshift');
  });
  - it('renders container State and Started in row', () => {
  - const startTime = Date.now();
  - pod.status.containerStatuses = [
  - {
  - 'name': 'hello-openshift',
  - 'state': {
  - 'running': {
  - 'startedAt': {startTime},
  - },
  - },
  - },
  - ];
  - wrapper = shallow(<ContainerRow pod={pod} container={container} />);
  - expect(wrapper.find('div').find({className: 'col-lg-2 col-md-2 col-sm-3 hidden-xs'}).find({status: 'Running'}).exists()).toBe(true);
  - expect(wrapper.find('Timestamp').find({timestamp: {startTime}}).exists()).toBe(true);
  + it('renders the container state', () => {
  + expect(wrapper.childAt(2).find({status: 'Running'}).exists()).toBe(true);
  });
  - it('renders container Restarts in row', () => {
  - pod.status.containerStatuses = [{'name': 'hello-openshift', 'restartCount': 10}];
  - wrapper = shallow(<ContainerRow pod={pod} container={container} />);
  - expect(wrapper.find('div').find({className: 'col-lg-1 col-md-2 hidden-sm hidden-xs'}).text()).toBe('10');
  + it('renders the container restart times', () => {
  + expect(wrapper.childAt(3).text()).toBe('10');
  });
  - it('renders container Exit Code in row', () => {
  - wrapper = shallow(<ContainerRow pod={pod} container={container} />);
  - expect(wrapper.find('div').find({className: 'col-lg-1 hidden-md hidden-sm hidden-xs'}).text()).toBe('-');
  + it('renders the container started time', () => {
  + expect(wrapper.childAt(4).find({timestamp: {startTime}}).exists()).toBe(true);
  + });
  +
  + it('renders the container finished time', () => {
  + expect(wrapper.childAt(5).find({timestamp: {finishTime}}).exists()).toBe(true);
  + });
  +
  + it('renders the container exit code', () => {
  + expect(wrapper.childAt(6).text()).toBe('-');
  });
  });
  