organizationRepositories.spec.tsx 1.3 KB

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