Commit b1bb448c authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '299213-project-filter-regression' into 'master'

Global Search - Project Filter sets Group

See merge request gitlab-org/gitlab!52015
parents 1561b0db e5dc4875
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
handleProjectChange(project) { handleProjectChange(project) {
// This determines if we need to update the group filter or not // This determines if we need to update the group filter or not
const queryParams = { const queryParams = {
...(project.namespace_id && { [GROUP_DATA.queryParam]: project.namespace_id }), ...(project.namespace?.id && { [GROUP_DATA.queryParam]: project.namespace.id }),
[PROJECT_DATA.queryParam]: project.id, [PROJECT_DATA.queryParam]: project.id,
}; };
......
---
title: Global Search - Project Filter sets Group
merge_request: 52015
author:
type: fixed
...@@ -26,7 +26,7 @@ export const MOCK_GROUPS = [ ...@@ -26,7 +26,7 @@ export const MOCK_GROUPS = [
export const MOCK_PROJECT = { export const MOCK_PROJECT = {
name: 'test project', name: 'test project',
namespace_id: MOCK_GROUP.id, namespace: MOCK_GROUP,
nameWithNamespace: 'test group test project', nameWithNamespace: 'test group test project',
id: 'test_1', id: 'test_1',
}; };
...@@ -34,13 +34,13 @@ export const MOCK_PROJECT = { ...@@ -34,13 +34,13 @@ export const MOCK_PROJECT = {
export const MOCK_PROJECTS = [ export const MOCK_PROJECTS = [
{ {
name: 'test project', name: 'test project',
namespace_id: MOCK_GROUP.id, namespace: MOCK_GROUP,
name_with_namespace: 'test group test project', name_with_namespace: 'test group test project',
id: 'test_1', id: 'test_1',
}, },
{ {
name: 'test project 2', name: 'test project 2',
namespace_id: MOCK_GROUP.id, namespace: MOCK_GROUP,
name_with_namespace: 'test group test project 2', name_with_namespace: 'test group test project 2',
id: 'test_2', id: 'test_2',
}, },
......
...@@ -99,7 +99,7 @@ describe('ProjectFilter', () => { ...@@ -99,7 +99,7 @@ describe('ProjectFilter', () => {
it('calls setUrlParams with project id, group id, then calls visitUrl', () => { it('calls setUrlParams with project id, group id, then calls visitUrl', () => {
expect(setUrlParams).toHaveBeenCalledWith({ expect(setUrlParams).toHaveBeenCalledWith({
[GROUP_DATA.queryParam]: MOCK_PROJECT.namespace_id, [GROUP_DATA.queryParam]: MOCK_PROJECT.namespace.id,
[PROJECT_DATA.queryParam]: MOCK_PROJECT.id, [PROJECT_DATA.queryParam]: MOCK_PROJECT.id,
}); });
expect(visitUrl).toHaveBeenCalled(); expect(visitUrl).toHaveBeenCalled();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment