Updating tests

This commit is contained in:
Justin 2018-06-05 21:49:34 -04:00
parent d4518e237c
commit 20ce703a2e
2 changed files with 8 additions and 8 deletions

View File

@ -80,11 +80,11 @@ async function getPaginated(service, endpoint, options = {}) {
return {
data,
pagination: {
total: response.headers['x-total']
total: response.headers['x-total'],
next: response.headers['x-next-page'] || null,
current: response.headers['x-page'] || null,
previous: response.headers['x-prev-page'] || null,
perPage: response.headers['x-per-page'],
next: response.headers['x-next-page'],
current: response.headers['x-page'],
previous: response.headers['x-prev-page'],
totalPages: response.headers['x-total-pages'],
},
};

View File

@ -57,10 +57,10 @@ const mockService2 = {
link: `<'https://www.test.com/api/v3/projects/8?page=1&per_page=2>; rel="prev", <'https://www.test.com/api/v3/projects/8?page=1&per_page=2>; rel="first", <'https://www.test.com/api/v3/projects/8?page=2&per_page=2>; rel="last"`,
'x-next-page': '',
'x-page': 2,
'x-per-Page': 2,
'x-prev-Page': 1,
'x-per-page': 2,
'x-prev-page': 1,
'x-total': 4,
'x-total-Pages': 2,
'x-total-pages': 2,
}
}
@ -128,7 +128,7 @@ describe('RequestHelper.get()', () => {
total: 4,
previous: 1,
current: 2,
next: '',
next: null,
perPage: 2,
totalPages: 2
})