Commit e753beec authored by Marvin Karegyeya's avatar Marvin Karegyeya Committed by Phil Hughes

Replace board service in board card spec.js

parent b90b96b3
---
title: removes references of BoardService
merge_request: 20881
author: nuwe1
type: other
...@@ -13,7 +13,7 @@ import '~/boards/models/list'; ...@@ -13,7 +13,7 @@ import '~/boards/models/list';
import store from '~/boards/stores'; import store from '~/boards/stores';
import boardsStore from '~/boards/stores/boards_store'; import boardsStore from '~/boards/stores/boards_store';
import boardCard from '~/boards/components/board_card.vue'; import boardCard from '~/boards/components/board_card.vue';
import { listObj, boardsMockInterceptor, mockBoardService } from './mock_data'; import { listObj, boardsMockInterceptor, setMockEndpoints } from './mock_data';
describe('Board card', () => { describe('Board card', () => {
let vm; let vm;
...@@ -22,8 +22,8 @@ describe('Board card', () => { ...@@ -22,8 +22,8 @@ describe('Board card', () => {
beforeEach(done => { beforeEach(done => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
mock.onAny().reply(boardsMockInterceptor); mock.onAny().reply(boardsMockInterceptor);
setMockEndpoints();
gl.boardService = mockBoardService();
boardsStore.create(); boardsStore.create();
boardsStore.detail.issue = {}; boardsStore.detail.issue = {};
......
import BoardService from '~/boards/services/board_service'; import BoardService from '~/boards/services/board_service';
import boardsStore from '~/boards/stores/boards_store'; import boardsStore from '~/boards/stores/boards_store';
export const setMockEndpoints = (opts = {}) => {
const boardsEndpoint = opts.boardsEndpoint || '/test/issue-boards/-/boards.json';
const listsEndpoint = opts.listsEndpoint || '/test/-/boards/1/lists';
const bulkUpdatePath = opts.bulkUpdatePath || '';
const boardId = opts.boardId || '1';
boardsStore.setEndpoints({
boardsEndpoint,
listsEndpoint,
bulkUpdatePath,
boardId,
});
};
export const boardObj = { export const boardObj = {
id: 1, id: 1,
name: 'test', name: 'test',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment