index.spec.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {render} from 'sentry-test/reactTestingLibrary';
  2. import OrganizationRepositoriesContainer from 'sentry/views/settings/organizationRepositories';
  3. describe('OrganizationRepositoriesContainer', function () {
  4. const context = TestStubs.routerContext();
  5. const organization = TestStubs.Organization();
  6. const router = TestStubs.router();
  7. beforeEach(function () {
  8. MockApiClient.clearMockResponses();
  9. });
  10. describe('without any providers', function () {
  11. beforeEach(function () {
  12. MockApiClient.addMockResponse({
  13. url: '/organizations/org-slug/repos/',
  14. body: [],
  15. });
  16. MockApiClient.addMockResponse({
  17. url: '/organizations/org-slug/config/repos/',
  18. body: {providers: []},
  19. });
  20. });
  21. it('is loading when initially rendering', function () {
  22. const wrapper = render(
  23. <OrganizationRepositoriesContainer
  24. router={router}
  25. routes={router.routes}
  26. params={router.params}
  27. routeParams={router.params}
  28. route={router.routes[0]}
  29. location={router.location}
  30. organization={organization}
  31. />,
  32. {
  33. context,
  34. }
  35. );
  36. expect(wrapper.container).toSnapshot();
  37. });
  38. });
  39. });