How to use the jest/vue_shared/components/issue/related_issuable_mock_data.defaultProps.endpoint 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 / issuable / related_issues / components / related_issues_root_spec.js View on Github external
it('displays a message from the backend upon error', () => {
        const input = '#123';
        const message = 'error';

        mock.onPost(defaultProps.endpoint).reply(409, { message });
        wrapper.vm.store.setPendingReferences([issuable1.reference, issuable2.reference]);

        expect(createFlash).not.toHaveBeenCalled();
        wrapper.vm.onPendingFormSubmit(input);

        return waitForPromises().then(() => {
          expect(createFlash).toHaveBeenCalledWith({
            message,
          });
        });
      });
    });
github gitlabhq / gitlabhq / spec / frontend / issuable / related_issues / components / related_issues_root_spec.js View on Github external
beforeEach(() => {
    mock = new MockAdapter(axios);
    mock.onGet(defaultProps.endpoint).reply(200, []);
  });