diff options
author | Simon Knox <psimyn@gmail.com> | 2017-09-06 16:49:19 +1000 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-09-06 16:55:23 +1000 |
commit | eff1c1213e4a5aefb86e52d71d58acfd19d494a5 (patch) | |
tree | 831486bf11b318dec15e50f1e3b7e25d3a66b393 /spec/javascripts/boards/mock_data.js | |
parent | ff73a4eac41016241339d58db660dfbad92ff8fb (diff) | |
download | gitlab-ce-eff1c1213e4a5aefb86e52d71d58acfd19d494a5.tar.gz |
backport boards specs
Diffstat (limited to 'spec/javascripts/boards/mock_data.js')
-rw-r--r-- | spec/javascripts/boards/mock_data.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/javascripts/boards/mock_data.js b/spec/javascripts/boards/mock_data.js index a64c3964ee3..0a93086985e 100644 --- a/spec/javascripts/boards/mock_data.js +++ b/spec/javascripts/boards/mock_data.js @@ -1,3 +1,4 @@ +/* global BoardService */ /* eslint-disable comma-dangle, no-unused-vars, quote-props */ const listObj = { @@ -28,19 +29,19 @@ const listObjDuplicate = { const BoardsMockData = { 'GET': { - '/test/issue-boards/board/1/lists{/id}/issues': { + '/test/boards/1{/id}/issues': { issues: [{ title: 'Testing', + id: 1, iid: 1, confidential: false, labels: [], assignees: [], }], - size: 1 } }, 'POST': { - '/test/issue-boards/board/1/lists{/id}': listObj + '/test/boards/1{/id}': listObj }, 'PUT': { '/test/issue-boards/board/1/lists{/id}': {} @@ -58,7 +59,22 @@ const boardsMockInterceptor = (request, next) => { })); }; +const mockBoardService = (opts = {}) => { + const boardsEndpoint = opts.boardsEndpoint || '/test/issue-boards/board'; + const listsEndpoint = opts.listsEndpoint || '/test/boards/1'; + const bulkUpdatePath = opts.bulkUpdatePath || ''; + const boardId = opts.boardId || '1'; + + return new BoardService({ + boardsEndpoint, + listsEndpoint, + bulkUpdatePath, + boardId, + }); +}; + window.listObj = listObj; window.listObjDuplicate = listObjDuplicate; window.BoardsMockData = BoardsMockData; window.boardsMockInterceptor = boardsMockInterceptor; +window.mockBoardService = mockBoardService; |