diff options
| author | Filipa Lacerda <lacerda.filipa@gmail.com> | 2017-02-16 12:30:18 +0000 |
|---|---|---|
| committer | Filipa Lacerda <lacerda.filipa@gmail.com> | 2017-02-16 12:30:18 +0000 |
| commit | ea7c7769570f2c9a371ace7a655082a95457aa5f (patch) | |
| tree | 7912ebf580498a662f5fbba1085faf6d5b0e630f /spec/javascripts/lib/utils | |
| parent | edecab2041c1be24f430bc4ab6615116273b6659 (diff) | |
| parent | 13615ef80da5b53c4c605878011e5998daf314f2 (diff) | |
| download | gitlab-ce-paginate-environments-bundle.tar.gz | |
Merge branch 'fe-paginated-environments-api' into 'paginate-environments-bundle'
paginate-environments-bundle
Integrate with new environments API
See merge request !8954
Diffstat (limited to 'spec/javascripts/lib/utils')
| -rw-r--r-- | spec/javascripts/lib/utils/common_utils_spec.js.es6 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/javascripts/lib/utils/common_utils_spec.js.es6 b/spec/javascripts/lib/utils/common_utils_spec.js.es6 index 006ede21093..f4d3e77e515 100644 --- a/spec/javascripts/lib/utils/common_utils_spec.js.es6 +++ b/spec/javascripts/lib/utils/common_utils_spec.js.es6 @@ -108,6 +108,30 @@ require('~/lib/utils/common_utils'); }); }); + describe('gl.utils.parseIntPagination', () => { + it('should parse to integers all string values and return pagination object', () => { + const pagination = { + 'X-PER-PAGE': 10, + 'X-PAGE': 2, + 'X-TOTAL': 30, + 'X-TOTAL-PAGES': 3, + 'X-NEXT-PAGE': 3, + 'X-PREV-PAGE': 1, + }; + + const expectedPagination = { + perPage: 10, + page: 2, + total: 30, + totalPages: 3, + nextPage: 3, + previousPage: 1, + }; + + expect(gl.utils.parseIntPagination(pagination)).toEqual(expectedPagination); + }); + }); + describe('gl.utils.isMetaClick', () => { it('should identify meta click on Windows/Linux', () => { const e = { |
