todoList.spec.jsx 1.2 KB

123456789101112131415161718192021222324252627282930
  1. import React from 'react';
  2. import {mount} from 'enzyme';
  3. import TodoList from 'app/components/onboardingWizard/todoList';
  4. describe('TodoList', function() {
  5. const routerContext = TestStubs.routerContext();
  6. it('does not render `upload source maps` task with no projects', function() {
  7. const organization = TestStubs.Organization();
  8. const wrapper = mount(<TodoList organization={organization} />, routerContext);
  9. expect(wrapper.find('h4[data-test-id=7]').exists()).toBe(false);
  10. });
  11. it('does not render `upload source maps` task with python project', function() {
  12. const organization = TestStubs.Organization({
  13. projects: [{platform: 'python'}],
  14. });
  15. const wrapper = mount(<TodoList organization={organization} />, routerContext);
  16. expect(wrapper.find('h4[data-test-id=7]').exists()).toBe(false);
  17. });
  18. it('renders `upload source maps` task with js project', function() {
  19. const organization = TestStubs.Organization({
  20. projects: [{platform: 'javascript-react'}],
  21. });
  22. const wrapper = mount(<TodoList organization={organization} />, routerContext);
  23. expect(wrapper.find('h4[data-test-id=7]').text()).toBe('Upload source maps');
  24. });
  25. });