import React from 'react';
import { shallow } from 'enzyme';
import CardList from '../CardList';
import CardItem from '../../../components/CardItem/CardItem';

describe('<CardList />', () => {
  let wrapper;
  let children;
  
  beforeEach(() => {
    wrapper = shallow(<CardList />);
  });

  describe('container globally', () => {
    it('renders without crashing', () => {
      expect(wrapper).toMatchSnapshot();
    });
  });
  
  describe('props', () => {
    it('renders with passed in children', () => {
      let dummyChildProps = {
        id: "1",
        map_id: "🚽",
        location: "Uknown",
        status: "😃",
        type: "No Gender Compromising",
        queue_time: "⏰",
        queue_level: "Uknown",
      };

      const dummyChild = shallow(<CardItem { ...dummyChildProps } />);

      let wrapperWithChild = shallow(<CardList  {...dummyChild} />)

      expect(wrapperWithChild).toMatchSnapshot();
    });
  });
});

