diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/frontend_integration/test_helpers/mock_server/routes/diffs.js | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) | |
download | gitlab-ce-9dc93a4519d9d5d7be48ff274127136236a3adb3.tar.gz |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'spec/frontend_integration/test_helpers/mock_server/routes/diffs.js')
-rw-r--r-- | spec/frontend_integration/test_helpers/mock_server/routes/diffs.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/frontend_integration/test_helpers/mock_server/routes/diffs.js b/spec/frontend_integration/test_helpers/mock_server/routes/diffs.js new file mode 100644 index 00000000000..8301627e842 --- /dev/null +++ b/spec/frontend_integration/test_helpers/mock_server/routes/diffs.js @@ -0,0 +1,22 @@ +import { getDiffsMetadata, getDiffsBatch } from 'test_helpers/fixtures'; +import { withValues } from 'test_helpers/utils/obj'; + +export default (server) => { + server.get('/:namespace/:project/-/merge_requests/:mrid/diffs_metadata.json', () => { + return getDiffsMetadata(); + }); + + server.get('/:namespace/:project/-/merge_requests/:mrid/diffs_batch.json', () => { + const { pagination, ...result } = getDiffsBatch(); + + return { + ...result, + pagination: withValues(pagination, { + current_page: null, + next_page: null, + total_pages: 1, + next_page_href: null, + }), + }; + }); +}; |