organizationRepositories.spec.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import {render} from 'sentry-test/reactTestingLibrary';
  2. import OrganizationRepositories from 'sentry/views/settings/organizationRepositories/organizationRepositories';
  3. describe('OrganizationRepositories', function () {
  4. const org = TestStubs.Organization();
  5. const router = TestStubs.router();
  6. const location = router.location;
  7. const routerProps = {router, location, routeParams: {}, routes: [], route: {}};
  8. it('renders without providers', function () {
  9. render(
  10. <OrganizationRepositories
  11. onRepositoryChange={jest.fn()}
  12. organization={org}
  13. itemList={[]}
  14. {...routerProps}
  15. />
  16. );
  17. });
  18. it('renders with a repository', function () {
  19. render(
  20. <OrganizationRepositories
  21. onRepositoryChange={jest.fn()}
  22. organization={org}
  23. itemList={[TestStubs.Repository()]}
  24. {...routerProps}
  25. />
  26. );
  27. });
  28. it('renders with a repository and github provider', function () {
  29. render(
  30. <OrganizationRepositories
  31. onRepositoryChange={jest.fn()}
  32. organization={org}
  33. itemList={[
  34. TestStubs.Repository({
  35. provider: {id: 'github', name: 'GitHub'},
  36. }),
  37. ]}
  38. {...routerProps}
  39. />
  40. );
  41. });
  42. });