mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
158 paginated data list (#180)
* working: rename OrganizationTeamsList to PaginatedDataList * convert org notifications list fully to PaginatedDataList * update NotificationList tests * refactor org access to use PaginatedDataList * update tests for org access refactor; fix pagination & sorting * restore Add Role functionality to Org roles * fix displayed text when list of items is empty * preserve query params when navigating through pagination * fix bugs after RBAC rebase * fix lint errors, fix add org access button
This commit is contained in:
@@ -15,6 +15,14 @@ describe('qs (qs.js)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('encodeQueryString omits null values', () => {
|
||||
const vals = {
|
||||
order_by: 'name',
|
||||
page: null,
|
||||
};
|
||||
expect(encodeQueryString(vals)).toEqual('order_by=name');
|
||||
});
|
||||
|
||||
test('parseQueryString returns the expected queryParams', () => {
|
||||
[
|
||||
['order_by=name&page=1&page_size=5', ['page', 'page_size'], { order_by: 'name', page: 1, page_size: 5 }],
|
||||
@@ -26,4 +34,16 @@ describe('qs (qs.js)', () => {
|
||||
expect(actualQueryParams).toEqual(expectedQueryParams);
|
||||
});
|
||||
});
|
||||
|
||||
test('parseQueryString should strip leading "?"', () => {
|
||||
expect(parseQueryString('?foo=bar&order_by=win')).toEqual({
|
||||
foo: 'bar',
|
||||
order_by: 'win',
|
||||
});
|
||||
|
||||
expect(parseQueryString('foo=bar&order_by=?win')).toEqual({
|
||||
foo: 'bar',
|
||||
order_by: '?win',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user