123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import {render} from 'sentry-test/reactTestingLibrary';
- import OrganizationRepositories from 'sentry/views/settings/organizationRepositories/organizationRepositories';
- describe('OrganizationRepositories', function () {
- const org = TestStubs.Organization();
- const router = TestStubs.router();
- const location = router.location;
- const routerProps = {router, location, routeParams: {}, routes: [], route: {}};
- it('renders without providers', function () {
- const {container} = render(
- <OrganizationRepositories
- onRepositoryChange={jest.fn()}
- organization={org}
- itemList={[]}
- {...routerProps}
- />
- );
- expect(container).toSnapshot();
- });
- it('renders with a repository', function () {
- const {container} = render(
- <OrganizationRepositories
- onRepositoryChange={jest.fn()}
- organization={org}
- itemList={[TestStubs.Repository()]}
- {...routerProps}
- />
- );
- expect(container).toSnapshot();
- });
- it('renders with a repository and github provider', function () {
- const {container} = render(
- <OrganizationRepositories
- onRepositoryChange={jest.fn()}
- organization={org}
- itemList={[
- TestStubs.Repository({
- provider: {id: 'github', name: 'GitHub'},
- }),
- ]}
- {...routerProps}
- />
- );
- expect(container).toSnapshot();
- });
- });
|