organizationRepositories.spec.tsx 1.4 KB

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