summaryrefslogtreecommitdiff
path: root/spec/javascripts/registry/getters_spec.js
blob: 839aa7189970032d6b2f7a7af3eb191d00ee9f8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import * as getters from '~/registry/stores/getters';

describe('Getters Registry Store', () => {
  let state;

  beforeEach(() => {
    state = {
      isLoading: false,
      endpoint: '/root/empty-project/container_registry.json',
      repos: [
        {
          canDelete: true,
          destroyPath: 'bar',
          id: '134',
          isLoading: false,
          list: [],
          location: 'foo',
          name: 'gitlab-org/omnibus-gitlab/foo',
          tagsPath: 'foo',
        },
        {
          canDelete: true,
          destroyPath: 'bar',
          id: '123',
          isLoading: false,
          list: [],
          location: 'foo',
          name: 'gitlab-org/omnibus-gitlab',
          tagsPath: 'foo',
        },
      ],
    };
  });

  describe('isLoading', () => {
    it('should return the isLoading property', () => {
      expect(getters.isLoading(state)).toEqual(state.isLoading);
    });
  });

  describe('repos', () => {
    it('should return the repos', () => {
      expect(getters.repos(state)).toEqual(state.repos);
    });
  });
});