1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import React from 'react';
- import {shallow} from 'sentry-test/enzyme';
- import ProjectChooser from 'app/views/projectChooser';
- describe('ProjectChooser', function() {
- const mockOrg = {
- id: 'org',
- slug: 'org',
- teams: [
- {
- name: 'Test Team',
- slug: 'test-team',
- isMember: true,
- projects: [
- {
- slug: 'test-project',
- name: 'Test Project',
- },
- {
- slug: 'another-project',
- name: 'Another Project',
- },
- ],
- },
- ],
- projects: [
- {
- slug: 'test-project',
- name: 'Test Project',
- isMember: true,
- team: {
- name: 'Test Team',
- slug: 'test-team',
- isMember: true,
- projects: [
- {
- slug: 'test-project',
- name: 'Test Project',
- },
- {
- slug: 'another-project',
- name: 'Another Project',
- },
- ],
- },
- },
- {
- slug: 'another-project',
- name: 'Another Project',
- isMember: true,
- team: {
- name: 'Test Team',
- slug: 'test-team',
- isMember: true,
- projects: [
- {
- slug: 'test-project',
- name: 'Test Project',
- },
- {
- slug: 'another-project',
- name: 'Another Project',
- },
- ],
- },
- },
- ],
- access: [],
- };
- it('renders', function() {
- const wrapper = shallow(
- <ProjectChooser
- location={{
- pathname: 'https://sentry.io/organizations/tester1/projects/choose/',
- query: {onboarding: '1', task: '2'},
- search: '?onboarding=1&task=2',
- }}
- />,
- {
- context: {
- organization: mockOrg,
- },
- }
- );
- expect(wrapper).toMatchSnapshot();
- });
- });
|