示例#1
0
  beforeEach(() => {
    gl.boardService = mockBoardService();
    boardsStore.create();

    issue = new ListIssue({
      title: 'Testing',
      id: 1,
      iid: 1,
      confidential: false,
      labels: [
        {
          id: 1,
          title: 'test',
          color: 'red',
          description: 'testing',
        },
      ],
      assignees: [
        {
          id: 1,
          name: 'name',
          username: '******',
          avatar_url: 'http://avatar_url',
        },
      ],
    });
  });
示例#2
0
  beforeEach(done => {
    mock = new MockAdapter(axios);
    mock.onAny().reply(boardsMockInterceptor);

    gl.boardService = mockBoardService();
    boardsStore.create();
    boardsStore.detail.issue = {};

    const BoardCardComp = Vue.extend(boardCard);
    const list = new List(listObj);
    const label1 = new ListLabel({
      id: 3,
      title: 'testing 123',
      color: 'blue',
      text_color: 'white',
      description: 'test',
    });

    setTimeout(() => {
      list.issues[0].labels.push(label1);

      vm = new BoardCardComp({
        propsData: {
          list,
          issue: list.issues[0],
          issueLinkBase: '/',
          disabled: false,
          index: 0,
          rootPath: '/',
        },
      }).$mount();
      done();
    }, 0);
  });
示例#3
0
  beforeEach(() => {
    mock = new MockAdapter(axios);
    mock.onAny().reply(boardsMockInterceptor);
    gl.boardService = mockBoardService();
    boardsStore.create();

    spyOn(gl.boardService, 'moveIssue').and.callFake(
      () =>
        new Promise(resolve => {
          resolve();
        }),
    );

    Cookies.set('issue_board_welcome_hidden', 'false', {
      expires: 365 * 10,
      path: '',
    });
  });
  beforeEach(done => {
    const Comp = Vue.extend(BoardBlankState);

    boardsStore.create();
    gl.boardService = mockBoardService();

    spyOn(gl.boardService, 'generateDefaultLists').and.callFake(
      () =>
        new Promise((resolve, reject) => {
          if (fail) {
            reject();
          } else {
            resolve({
              data: [
                {
                  id: 1,
                  title: 'To Do',
                  label: { id: 1 },
                },
                {
                  id: 2,
                  title: 'Doing',
                  label: { id: 2 },
                },
              ],
            });
          }
        }),
    );

    vm = new Comp();

    setTimeout(() => {
      vm.$mount();
      done();
    });
  });