From dce47d918a26eb981db30d07d9a6ff5d8b17246e Mon Sep 17 00:00:00 2001 From: Boris Petrov Date: Fri, 1 Apr 2022 17:09:14 +0300 Subject: [PATCH] Add a couple of tests to test passing empty `queryParams` to `replaceWith` --- .../router_service_test/replaceWith_test.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/ember/tests/routing/router_service_test/replaceWith_test.js b/packages/ember/tests/routing/router_service_test/replaceWith_test.js index ea0683b13a3..38937f0c04a 100644 --- a/packages/ember/tests/routing/router_service_test/replaceWith_test.js +++ b/packages/ember/tests/routing/router_service_test/replaceWith_test.js @@ -136,5 +136,29 @@ moduleFor( assert.deepEqual(this.state, ['/', '/child']); }); } + + ['@test RouterService#replaceWith with empty query params'](assert) { + assert.expect(1); + + return this.visit('/') + .then(() => { + return this.routerService.replaceWith('parent.child', { queryParams: {} }); + }) + .then(() => { + assert.deepEqual(this.state, ['/child']); + }); + } + + ['@test RouterService#replaceWith with `undefined` in query params'](assert) { + assert.expect(1); + + return this.visit('/') + .then(() => { + return this.routerService.replaceWith('parent.child', { queryParams: undefined }); + }) + .then(() => { + assert.deepEqual(this.state, ['/child']); + }); + } } );