Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions static/app/views/issueList/groupListBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {LoadingStreamGroup, StreamGroup} from 'sentry/components/stream/group';
import {SupergroupRow} from 'sentry/components/stream/supergroups/supergroupRow';
import {GroupStore} from 'sentry/stores/groupStore';
import type {Group} from 'sentry/types/group';
import {useApi} from 'sentry/utils/useApi';
import {useMedia} from 'sentry/utils/useMedia';
import {useOrganization} from 'sentry/utils/useOrganization';
import {useSyncedLocalStorageState} from 'sentry/utils/useSyncedLocalStorageState';
Expand Down Expand Up @@ -95,7 +94,6 @@ export function GroupListBody({
onActionTaken,
supergroupLookup,
}: GroupListBodyProps) {
const api = useApi();
const organization = useOrganization();

if (loading) {
Expand All @@ -114,7 +112,6 @@ export function GroupListBody({
if (!groupIds.length) {
return (
<NoGroupsHandler
api={api}
organization={organization}
query={query}
selectedProjectIds={selectedProjectIds}
Expand Down
38 changes: 36 additions & 2 deletions static/app/views/issueList/noGroupsHandler/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {NoGroupsHandler} from 'sentry/views/issueList/noGroupsHandler';

describe('NoGroupsHandler', () => {
const defaultProps = {
api: new MockApiClient(),
query: '',
organization: OrganizationFixture(),
groupIds: [],
selectedProjectIds: [],
};

it('displays default empty state when first event has been sent', async () => {
MockApiClient.addMockResponse({
const projectsMock = MockApiClient.addMockResponse({
url: '/organizations/org-slug/projects/',
body: [],
});
Expand All @@ -25,6 +25,40 @@ describe('NoGroupsHandler', () => {
render(<NoGroupsHandler {...defaultProps} />);

expect(await screen.findByText('No issues match your search')).toBeInTheDocument();
expect(projectsMock).not.toHaveBeenCalled();
});

it('collapses latest deploys when looking up the selected project', async () => {
const projectsMock = MockApiClient.addMockResponse({
url: '/organizations/org-slug/projects/',
body: [],
});
const sentFirstEventMock = MockApiClient.addMockResponse({
url: '/organizations/org-slug/sent-first-event/',
body: {sentFirstEvent: false},
});

render(<NoGroupsHandler {...defaultProps} selectedProjectIds={[1844558]} />);

expect(await screen.findByText(/Waiting for events/i)).toBeInTheDocument();
expect(sentFirstEventMock).toHaveBeenCalledWith(
'/organizations/org-slug/sent-first-event/',
expect.objectContaining({
query: expect.objectContaining({
project: [1844558],
}),
})
);
expect(projectsMock).toHaveBeenCalledWith(
'/organizations/org-slug/projects/',
expect.objectContaining({
query: expect.objectContaining({
collapse: ['latestDeploys', 'unusedFeatures'],
per_page: 1,
query: 'id:1844558',
}),
})
);
});

it('displays default empty state when an error occurs', async () => {
Expand Down
Loading
Loading