How to use the jest/boards/mock_data.mockIssue.id 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 / boards / components / sidebar / board_sidebar_labels_select_spec.js View on Github external
beforeEach(async () => {
      createWrapper();

      jest.spyOn(wrapper.vm, 'setActiveBoardItemLabels').mockImplementation(() => TEST_LABELS);
      findLabelsSelect().vm.$emit('updateSelectedLabels', TEST_LABELS_PAYLOAD);
      store.state.boardItems[TEST_ISSUE.id].labels = TEST_LABELS;
      await wrapper.vm.$nextTick();
    });
github gitlabhq / gitlabhq / spec / frontend / boards / components / sidebar / board_sidebar_labels_select_spec.js View on Github external
const createWrapper = ({ labels = [], providedValues = {} } = {}) => {
    store = createStore();
    store.state.boardItems = { [TEST_ISSUE.id]: { ...TEST_ISSUE, labels } };
    store.state.activeId = TEST_ISSUE.id;

    wrapper = shallowMount(BoardSidebarLabelsSelect, {
      store,
      provide: {
        canUpdate: true,
        labelsManagePath: TEST_HOST,
        labelsFilterBasePath: TEST_HOST,
        ...providedValues,
      },
      stubs: {
        BoardEditableItem,
        LabelsSelect: true,
      },
    });
  };