Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sidebar_service_spec.js « sidebar « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ed7be76dbcc8d26e3671060b193d30cb947086f3 (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
import Vue from 'vue';
import SidebarService from '~/sidebar/services/sidebar_service';
import Mock from './mock_data';

describe('Sidebar service', () => {
  beforeEach(() => {
    Vue.http.interceptors.push(Mock.sidebarMockInterceptor);
    this.service = new SidebarService('/gitlab-org/gitlab-shell/issues/5.json');
  });

  afterEach(() => {
    SidebarService.singleton = null;
  });

  it('gets the data', (done) => {
    this.service.get().then((resp) => {
      expect(resp).toBeDefined();
      done();
    });
  });

  it('updates the data', (done) => {
    this.service.update('issue[assignee_ids]', [1]).then((resp) => {
      expect(resp).toBeDefined();
      done();
    });
  });
});