Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/monitoring/store_utils.js')
-rw-r--r--spec/frontend/monitoring/store_utils.js32
1 files changed, 25 insertions, 7 deletions
diff --git a/spec/frontend/monitoring/store_utils.js b/spec/frontend/monitoring/store_utils.js
index eb2578aa9db..6c8267e6a3c 100644
--- a/spec/frontend/monitoring/store_utils.js
+++ b/spec/frontend/monitoring/store_utils.js
@@ -8,7 +8,10 @@ export const setMetricResult = ({ store, result, group = 0, panel = 0, metric =
store.commit(`monitoringDashboard/${types.RECEIVE_METRIC_RESULT_SUCCESS}`, {
metricId,
- result,
+ data: {
+ resultType: 'matrix',
+ result,
+ },
});
};
@@ -32,12 +35,6 @@ export const setupStoreWithDashboard = store => {
);
};
-export const setupStoreWithVariable = store => {
- store.commit(`monitoringDashboard/${types.SET_VARIABLES}`, {
- label1: 'pod',
- });
-};
-
export const setupStoreWithLinks = store => {
store.commit(`monitoringDashboard/${types.RECEIVE_METRICS_DASHBOARD_SUCCESS}`, {
...metricsDashboardPayload,
@@ -60,3 +57,24 @@ export const setupStoreWithData = store => {
setEnvironmentData(store);
};
+
+export const setupStoreWithDataForPanelCount = (store, panelCount) => {
+ const payloadPanelGroup = metricsDashboardPayload.panel_groups[0];
+
+ const panelGroupCustom = {
+ ...payloadPanelGroup,
+ panels: payloadPanelGroup.panels.slice(0, panelCount),
+ };
+
+ const metricsDashboardPayloadCustom = {
+ ...metricsDashboardPayload,
+ panel_groups: [panelGroupCustom],
+ };
+
+ store.commit(
+ `monitoringDashboard/${types.RECEIVE_METRICS_DASHBOARD_SUCCESS}`,
+ metricsDashboardPayloadCustom,
+ );
+
+ setMetricResult({ store, result: metricsResult, panel: 0 });
+};