diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-07 18:02:49 +0000 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-02-07 18:33:00 +0000 |
commit | df469864b1ab1e0bfaa1e843d3d0a84042604646 (patch) | |
tree | 81a59a012180c8e2c43f8573a50d5ddec26040ab /spec/javascripts/boards/mock_data.js | |
parent | bc13687c7e374116e4830d004b82e9960d3a55cc (diff) | |
download | gitlab-ce-update-filenames-regex.tar.gz |
Updated the filename regexupdate-filenames-regex
Diffstat (limited to 'spec/javascripts/boards/mock_data.js')
-rw-r--r-- | spec/javascripts/boards/mock_data.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/spec/javascripts/boards/mock_data.js b/spec/javascripts/boards/mock_data.js new file mode 100644 index 00000000000..7a399b307ad --- /dev/null +++ b/spec/javascripts/boards/mock_data.js @@ -0,0 +1,63 @@ +/* eslint-disable comma-dangle, no-unused-vars, quote-props */ + +const listObj = { + id: 1, + position: 0, + title: 'Test', + list_type: 'label', + label: { + id: 1, + title: 'Testing', + color: 'red', + description: 'testing;' + } +}; + +const listObjDuplicate = { + id: 2, + position: 1, + title: 'Test', + list_type: 'label', + label: { + id: 2, + title: 'Testing', + color: 'red', + description: 'testing;' + } +}; + +const BoardsMockData = { + 'GET': { + '/test/issue-boards/board/1/lists{/id}/issues': { + issues: [{ + title: 'Testing', + iid: 1, + confidential: false, + labels: [] + }], + size: 1 + } + }, + 'POST': { + '/test/issue-boards/board/1/lists{/id}': listObj + }, + 'PUT': { + '/test/issue-boards/board/1/lists{/id}': {} + }, + 'DELETE': { + '/test/issue-boards/board/1/lists{/id}': {} + } +}; + +const boardsMockInterceptor = (request, next) => { + const body = BoardsMockData[request.method][request.url]; + + next(request.respondWith(JSON.stringify(body), { + status: 200 + })); +}; + +window.listObj = listObj; +window.listObjDuplicate = listObjDuplicate; +window.BoardsMockData = BoardsMockData; +window.boardsMockInterceptor = boardsMockInterceptor; |