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

getters_spec.js « embed_group « store « monitoring « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e3241e41f5ef8ac4db6ced6db8ebb79660f50951 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { metricsWithData } from '~/monitoring/stores/embed_group/getters';
import { mockNamespaces } from '../../mock_data';

describe('Embed group getters', () => {
  describe('metricsWithData', () => {
    it('correctly sums the number of metrics with data', () => {
      const mockMetric = {};
      const state = {
        modules: mockNamespaces,
      };
      const rootGetters = {
        [`${mockNamespaces[0]}/metricsWithData`]: () => [mockMetric],
        [`${mockNamespaces[1]}/metricsWithData`]: () => [mockMetric, mockMetric],
      };

      expect(metricsWithData(state, null, null, rootGetters)).toEqual([1, 2]);
    });
  });
});