From d324c12348572d3aa9045d7feffc88e03597a91d Mon Sep 17 00:00:00 2001 From: "Keith J. Grant" Date: Tue, 18 May 2021 12:20:24 -0700 Subject: [PATCH] add qs test confirming default values are omitted --- awx/ui_next/src/util/qs.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/awx/ui_next/src/util/qs.test.js b/awx/ui_next/src/util/qs.test.js index d1806a2272..5c0d8ed1b6 100644 --- a/awx/ui_next/src/util/qs.test.js +++ b/awx/ui_next/src/util/qs.test.js @@ -899,6 +899,17 @@ describe('qs (qs.js)', () => { ); }); + test('should omit default values', () => { + const query = 'template.page=2'; + const newParams = { + page: 3, + page_size: 5, + }; + expect(replaceNamespacedParams(config, query, newParams)).toEqual( + 'template.page=3' + ); + }); + // This fix needed after we're confident refactoring components // to use replaceNamespacedParams provides equivalent functionality test.skip('should not alter params of other namespaces', () => {