Skip to content

fix(sentry10): Remove project dashboard result from search #13597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ async function createProjectResults(projectsPromise, orgId) {
const projects = (await projectsPromise) || [];
return flatten(
projects.map(project => [
{
title: `${project.slug} Dashboard`,
description: 'Project Dashboard',
model: project,
sourceType: 'project',
resultType: 'route',
to: `/${orgId}/${project.slug}/`,
},
{
title: `${project.slug} Settings`,
description: 'Project Settings',
Expand Down
20 changes: 4 additions & 16 deletions tests/js/spec/components/search/sources/apiSource.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,6 @@ describe('ApiSource', function() {
matches: expect.anything(),
score: expect.anything(),
}),
expect.objectContaining({
item: expect.objectContaining({
model: expect.objectContaining({
slug: 'foo-project',
}),
sourceType: 'project',
resultType: 'route',
to: '/org-slug/foo-project/',
}),
matches: expect.anything(),
score: expect.anything(),
}),
expect.objectContaining({
item: expect.objectContaining({
model: expect.objectContaining({
Expand All @@ -256,7 +244,7 @@ describe('ApiSource', function() {
});

// There are no members that match
expect(mock.mock.calls[1][0].results).toHaveLength(5);
expect(mock.mock.calls[1][0].results).toHaveLength(4);
});

it('render function is called with correct results when API requests partially succeed', async function() {
Expand Down Expand Up @@ -321,16 +309,16 @@ describe('ApiSource', function() {
wrapper.update();

// There are no members that match
expect(mock.mock.calls[1][0].results).toHaveLength(5);
expect(mock.mock.calls[1][0].results).toHaveLength(4);
expect(mock.mock.calls[1][0].results[0].item.model.slug).toBe('foo-org');

mock.mockClear();
wrapper.setProps({query: 'foo-t'});
await tick();
wrapper.update();

// Still have 5 results, but is re-ordered
expect(mock.mock.calls[0][0].results).toHaveLength(5);
// Still have 4 results, but is re-ordered
expect(mock.mock.calls[0][0].results).toHaveLength(4);
expect(mock.mock.calls[0][0].results[0].item.model.slug).toBe('foo-team');
});

Expand Down