How to use the jest/monitoring/mock_data.graphDataPrometheusQueryRange.metrics function in jest

To help you get started, we’ve selected a few jest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gitlabhq / gitlabhq / spec / frontend / monitoring / components / panel_type_spec.js View on Github external
it('is present when the panel contains an edit_path property', () => {
      wrapper.setProps({
        graphData: {
          ...graphDataPrometheusQueryRange,
          metrics: [
            {
              ...graphDataPrometheusQueryRange.metrics[0],
              edit_path: '/root/kubernetes-gke-project/prometheus/metrics/23/edit',
            },
          ],
        },
      });

      return wrapper.vm.$nextTick(() => {
        expect(findEditCustomMetricLink().exists()).toBe(true);
      });
    });
github gitlabhq / gitlabhq / spec / frontend / monitoring / components / panel_type_spec.js View on Github external
it('shows an "Edit metrics" link for a panel with multiple metrics', () => {
      wrapper.setProps({
        graphData: {
          ...graphDataPrometheusQueryRange,
          metrics: [
            {
              ...graphDataPrometheusQueryRange.metrics[0],
              edit_path: '/root/kubernetes-gke-project/prometheus/metrics/23/edit',
            },
            {
              ...graphDataPrometheusQueryRange.metrics[0],
              edit_path: '/root/kubernetes-gke-project/prometheus/metrics/23/edit',
            },
          ],
        },
      });

      return wrapper.vm.$nextTick(() => {
        expect(findEditCustomMetricLink().text()).toBe('Edit metrics');
      });
    });
  });