platformList.spec.jsx 753 B

1234567891011121314151617181920
  1. import React from 'react';
  2. import {mount} from 'enzyme';
  3. import PlatformList from 'app/components/platformList';
  4. describe('PlatformList', function() {
  5. it('renders max of three icons from platforms', function() {
  6. const platforms = ['java', 'php', 'javascript', 'cocoa', 'ruby'];
  7. const wrapper = mount(<PlatformList platforms={platforms} />);
  8. const icons = wrapper.find('StyledPlatformIcon');
  9. expect(icons).toHaveLength(3);
  10. });
  11. it('renders default if no platforms', function() {
  12. const platforms = [];
  13. const wrapper = mount(<PlatformList platforms={platforms} />);
  14. const icons = wrapper.find('StyledPlatformIcon');
  15. expect(icons.first().prop('platform')).toBe('default');
  16. expect(icons).toHaveLength(1);
  17. });
  18. });