project_empty_state_spec.js 1.1 KB
Newer Older
1 2 3 4 5
import Vuex from 'vuex';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import { GlSprintf } from '@gitlab/ui';
import { GlEmptyState } from '../stubs';
import projectEmptyState from '~/registry/explorer/components/project_empty_state.vue';
6
import * as getters from '~/registry/explorer/stores/getters';
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

const localVue = createLocalVue();
localVue.use(Vuex);

describe('Registry Project Empty state', () => {
  let wrapper;
  let store;

  beforeEach(() => {
    store = new Vuex.Store({
      state: {
        config: {
          repositoryUrl: 'foo',
          registryHostUrlWithPort: 'bar',
          helpPagePath: 'baz',
          twoFactorAuthHelpLink: 'barBaz',
          personalAccessTokensHelpLink: 'fooBaz',
          noContainersImage: 'bazFoo',
        },
      },
27
      getters,
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
    });
    wrapper = shallowMount(projectEmptyState, {
      localVue,
      store,
      stubs: {
        GlEmptyState,
        GlSprintf,
      },
    });
  });

  afterEach(() => {
    wrapper.destroy();
  });

  it('to match the default snapshot', () => {
    expect(wrapper.element).toMatchSnapshot();
  });
});