diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-28 21:06:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-28 21:06:11 +0300 |
commit | 4f05a630951858cc2b7dafada27f3dcf87ba29bd (patch) | |
tree | 1b87468300c53594465ca10f89e082651a08707c /spec/javascripts/boards | |
parent | 7cdd70dcec27402e89e65451b4b1feb75b5eb267 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts/boards')
-rw-r--r-- | spec/javascripts/boards/board_card_spec.js | 4 | ||||
-rw-r--r-- | spec/javascripts/boards/mock_data.js | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/spec/javascripts/boards/board_card_spec.js b/spec/javascripts/boards/board_card_spec.js index 51433a58212..72367377929 100644 --- a/spec/javascripts/boards/board_card_spec.js +++ b/spec/javascripts/boards/board_card_spec.js @@ -13,7 +13,7 @@ import '~/boards/models/list'; import store from '~/boards/stores'; import boardsStore from '~/boards/stores/boards_store'; 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', () => { let vm; @@ -22,8 +22,8 @@ describe('Board card', () => { beforeEach(done => { mock = new MockAdapter(axios); mock.onAny().reply(boardsMockInterceptor); + setMockEndpoints(); - gl.boardService = mockBoardService(); boardsStore.create(); boardsStore.detail.issue = {}; diff --git a/spec/javascripts/boards/mock_data.js b/spec/javascripts/boards/mock_data.js index 41b8f567e08..bd295ba61ac 100644 --- a/spec/javascripts/boards/mock_data.js +++ b/spec/javascripts/boards/mock_data.js @@ -1,6 +1,20 @@ import BoardService from '~/boards/services/board_service'; 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 = { id: 1, name: 'test', |