From b96a80637b2f86bd8436e9aaef83b0c2c704fb31 Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Thu, 26 Aug 2021 17:12:12 +0200 Subject: SONAR-13736 Keep search query when browsing code file --- server/sonar-web/src/main/js/helpers/mocks/component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'server/sonar-web/src/main/js/helpers') diff --git a/server/sonar-web/src/main/js/helpers/mocks/component.ts b/server/sonar-web/src/main/js/helpers/mocks/component.ts index 990ad003a5c..19149a524c2 100644 --- a/server/sonar-web/src/main/js/helpers/mocks/component.ts +++ b/server/sonar-web/src/main/js/helpers/mocks/component.ts @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { ComponentQualifier } from '../../types/component'; +import { ComponentQualifier, TreeComponent } from '../../types/component'; import { MetricKey } from '../../types/metrics'; import { mockMeasureEnhanced } from '../testMocks'; @@ -41,6 +41,16 @@ export function mockComponent(overrides: Partial = {}): T.Component }; } +export function mockTreeComponent(overrides: Partial): TreeComponent { + return { + key: 'my-key', + qualifier: ComponentQualifier.Project, + name: 'component', + visibility: 'public', + ...overrides + }; +} + export function mockComponentMeasure( file = false, overrides: Partial = {} -- cgit v1.2.3