From dd0c220f16bd5e72f7b1f4ee3e403eb7f81b58af Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 6 Nov 2024 10:43:59 -0500 Subject: [PATCH] Lint:Fix the serialize query params test --- .../unit/utils/serialize-query-params-test.js | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/test-app/tests/unit/utils/serialize-query-params-test.js b/test-app/tests/unit/utils/serialize-query-params-test.js index d7ed5177..7ac25547 100644 --- a/test-app/tests/unit/utils/serialize-query-params-test.js +++ b/test-app/tests/unit/utils/serialize-query-params-test.js @@ -1,52 +1,47 @@ import { module, test } from 'qunit'; import { serializeQueryParams } from 'ember-fetch/utils/serialize-query-params'; - -module('Unit | serializeQueryParams', function() { - test('serializeQueryParams turns deeply nested objects into queryParams like $.param', function(assert) { - assert.expect(1); - +module('Unit | serializeQueryParams', function () { + test('serializeQueryParams turns deeply nested objects into queryParams like $.param', function (assert) { const body = { a: 1, b: 2, c: { d: 3, e: { - f: 4 + f: 4, }, - g: [5, 6, 7] - } + g: [5, 6, 7], + }, }; const queryParamString = serializeQueryParams(body); - assert.equal( + assert.strictEqual( queryParamString, - 'a=1&b=2&c%5Bd%5D=3&c%5Be%5D%5Bf%5D=4&c%5Bg%5D%5B%5D=5&c%5Bg%5D%5B%5D=6&c%5Bg%5D%5B%5D=7' + 'a=1&b=2&c%5Bd%5D=3&c%5Be%5D%5Bf%5D=4&c%5Bg%5D%5B%5D=5&c%5Bg%5D%5B%5D=6&c%5Bg%5D%5B%5D=7', ); }); - test('serializeQueryParams does not serialize keys with undefined values', function(assert) { - assert.expect(1); - + test('serializeQueryParams does not serialize keys with undefined values', function (assert) { const body = { a: undefined, b: 2, c: { d: undefined, e: { - f: 4 + f: 4, }, - g: [5, 6, 7] + g: [5, 6, 7], }, h: null, i: 0, - j: false + j: false, }; const queryParamString = serializeQueryParams(body); - assert.equal( + assert.strictEqual( queryParamString, - 'b=2&c%5Be%5D%5Bf%5D=4&c%5Bg%5D%5B%5D=5&c%5Bg%5D%5B%5D=6&c%5Bg%5D%5B%5D=7&h=&i=0&j=false' + 'b=2&c%5Be%5D%5Bf%5D=4&c%5Bg%5D%5B%5D=5&c%5Bg%5D%5B%5D=6&c%5Bg%5D%5B%5D=7&h=&i=0&j=false', ); }); });