How to use the vuex-mock-store.Store function in vuex-mock-store

To help you get started, we’ve selected a few vuex-mock-store 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 ktmouk / hackaru-desktop / __tests__ / renderer / pages / settings / trackers.spec.js View on Github external
describe('Trackers', () => {
  let wrapper;

  const localVue = createLocalVue();
  localVue.directive('tooltip', () => {});

  const $store = new Store({
    getters: {
      'trackers/all': [
        {
          id: 1,
          process: 'Firefox',
          project: {
            name: 'Developments',
            color: '#ccc'
          }
        }
      ]
    }
  });
  const $electron = {
    ipcRenderer: {
      send: jest.fn()
github ktmouk / hackaru-desktop / __tests__ / components / organisms / index.spec.js View on Github external
describe('Activity', () => {
  let wrapper;

  const $store = new Store({});
  const $electron = {
    ipcRenderer: {
      send: jest.fn()
    }
  };

  const factory = () =>
    shallowMount(Activity, {
      propsData: {
        id: 1,
        description: 'Review',
        startedAt: '2019-01-31T01:23:45',
        stoppedAt: '2019-02-01T01:23:45',
        project: {
          id: 2
        }
github ktmouk / hackaru-desktop / __tests__ / renderer / pages / settings / power-monitor.spec.js View on Github external
describe('PowerMonitor', () => {
  let wrapper;

  const $store = new Store({
    getters: {
      'activities/stopOnShutdown': false,
      'activities/stopOnSuspend': false
    }
  });

  const factory = () =>
    shallowMount(PowerMonitor, {
      mocks: {
        $store
      }
    });

  describe('when click suspend-checkbox', () => {
    beforeEach(() => {
      wrapper = factory();
github ktmouk / hackaru-desktop / __tests__ / renderer / pages / auth.spec.js View on Github external
describe('Auth', () => {
  let wrapper;

  const $store = new Store({});
  const $electron = {
    ipcRenderer: {
      send: jest.fn(),
      on: () => {}
    }
  };

  const factory = () =>
    shallowMount(Auth, {
      mocks: {
        $store,
        $electron
      }
    });

  describe('when click submit-button', () => {
github ktmouk / hackaru-desktop / __tests__ / renderer / components / organisms / big-timer.spec.js View on Github external
describe('BigTimer', () => {
  let wrapper;

  MockDate.set('2019-01-31T01:23:45');

  const localVue = createLocalVue();
  localVue.directive('tooltip', () => {});

  const $store = new Store({
    getters: {
      'activities/working': [],
      'suggestions/all': [
        {
          project: {
            id: 2,
            name: 'Review',
            color: '#ff0'
          },
          description: 'Review my tasks'
        }
      ]
    }
  });

  const factory = () =>
github ktmouk / hackaru-desktop / __tests__ / renderer / pages / settings / tracker-editor.spec.js View on Github external
describe('TrackerEditor', () => {
  let wrapper;

  const $store = new Store({
    getters: {
      'processes/all': []
    }
  });

  const closeWindow = jest.fn();
  const $electron = {
    remote: {
      getCurrentWindow: () => ({
        close: closeWindow
      })
    }
  };

  const factory = () =>
    shallowMount(TrackerEditor, {
github ktmouk / hackaru-desktop / __tests__ / pages / activity-editor.spec.js View on Github external
describe('ActivityEditor', () => {
  let wrapper;

  const $store = new Store({});
  const closeWindow = jest.fn();
  const $electron = {
    remote: {
      getCurrentWindow: () => ({
        close: closeWindow
      })
    }
  };

  const factory = () =>
    shallowMount(ActivityEditor, {
      mocks: {
        $store,
        $electron,
        $route: { query: {} }
      }
github ktmouk / hackaru-desktop / __tests__ / components / molecules / project-select.spec.js View on Github external
describe('ProjectSelect', () => {
  let wrapper;

  const $store = new Store({
    getters: {
      'projects/getProjects': [
        {
          id: 1,
          name: 'Development',
          color: '#ccc'
        }
      ]
    }
  });

  const factory = () =>
    shallowMount(ProjectSelect, {
      mocks: {
        $store
      }
github ktmouk / hackaru-desktop / __tests__ / renderer / pages / index.spec.js View on Github external
describe('Index', () => {
  let wrapper;

  const localVue = createLocalVue();
  localVue.directive('tooltip', () => {});

  const $store = new Store({
    getters: {
      'activities/workings': [
        {
          id: 1,
          project: { id: 2 },
          description: 'Review',
          startedAt: '2019-01-01T01:23:45'
        }
      ],
      'auth/webUrl': 'http://app.hackaru.app'
    }
  });

  const $electron = {
    ipcRenderer: {
      send: jest.fn()
github ktmouk / hackaru-desktop / __tests__ / renderer / components / molecules / toast.spec.js View on Github external
describe('Toast', () => {
  let wrapper;

  jest.useFakeTimers();

  const $store = new Store({
    getters: {
      'toast/message': {
        text: 'message',
        type: 'success',
        rand: 12345,
        duration: 500
      }
    }
  });

  const $electron = {
    remote: {
      getCurrentWindow: () => ({
        isVisible: () => true
      })
    }

vuex-mock-store

Simple and straightforward mock for Vuex v3.x Store

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis

Popular vuex-mock-store functions