organizationRepositories.spec.tsx 1.3 KB

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