aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2021-08-26 17:12:12 +0200
committersonartech <sonartech@sonarsource.com>2021-08-30 20:08:20 +0000
commitb96a80637b2f86bd8436e9aaef83b0c2c704fb31 (patch)
tree800a4405f0a563feb1015cb89954d22c185fb62a /server/sonar-web/src/main/js/helpers
parent49789f6a622f402e85a72b9b77b9dfa827785a60 (diff)
downloadsonarqube-b96a80637b2f86bd8436e9aaef83b0c2c704fb31.tar.gz
sonarqube-b96a80637b2f86bd8436e9aaef83b0c2c704fb31.zip
SONAR-13736 Keep search query when browsing code file
Diffstat (limited to 'server/sonar-web/src/main/js/helpers')
-rw-r--r--server/sonar-web/src/main/js/helpers/mocks/component.ts12
1 files changed, 11 insertions, 1 deletions
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> = {}): T.Component
};
}
+export function mockTreeComponent(overrides: Partial<TreeComponent>): TreeComponent {
+ return {
+ key: 'my-key',
+ qualifier: ComponentQualifier.Project,
+ name: 'component',
+ visibility: 'public',
+ ...overrides
+ };
+}
+
export function mockComponentMeasure(
file = false,
overrides: Partial<T.ComponentMeasure> = {}