From 6136f07083c75bcca8e2318ee89afb3ef0c523f1 Mon Sep 17 00:00:00 2001 From: simonmilord Date: Mon, 4 Nov 2024 10:45:10 -0500 Subject: [PATCH] feedback --- .../quanticStandaloneSearchBox.test.js | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/quantic/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js b/packages/quantic/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js index 403c7bd08f2..f6ea6375373 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js +++ b/packages/quantic/force-app/main/default/lwc/quanticStandaloneSearchBox/__tests__/quanticStandaloneSearchBox.test.js @@ -114,32 +114,6 @@ describe('c-quantic-standalone-search-box', () => { expect(() => createTestComponent()).not.toThrow(); }); - describe('when the current page reference changes', () => { - beforeAll(() => { - Object.defineProperty(window, 'location', { - writable: true, - value: {href: nonStandaloneURL}, - }); - }); - - it('should properly pass the keepFiltersOnSearch property to the quanticSearchBox', async () => { - const element = createTestComponent({ - ...defaultOptions, - keepFiltersOnSearch: false, - }); - // eslint-disable-next-line @lwc/lwc/no-unexpected-wire-adapter-usages - CurrentPageReference.emit({url: nonStandaloneURL}); - await flushPromises(); - - const searchBox = element.shadowRoot.querySelector( - 'c-quantic-search-box' - ); - - expect(searchBox).not.toBeNull(); - expect(searchBox.keepFiltersOnSearch).toEqual(false); - }); - }); - describe('controller initialization', () => { it('should subscribe to the headless state changes', async () => { createTestComponent(); @@ -148,6 +122,32 @@ describe('c-quantic-standalone-search-box', () => { expect(functionsMocks.subscribe).toHaveBeenCalledTimes(1); }); + describe('when the current page reference changes', () => { + beforeAll(() => { + Object.defineProperty(window, 'location', { + writable: true, + value: {href: nonStandaloneURL}, + }); + }); + + it('should properly pass the keepFiltersOnSearch property to the quanticSearchBox', async () => { + const element = createTestComponent({ + ...defaultOptions, + keepFiltersOnSearch: false, + }); + // eslint-disable-next-line @lwc/lwc/no-unexpected-wire-adapter-usages + CurrentPageReference.emit({url: nonStandaloneURL}); + await flushPromises(); + + const searchBox = element.shadowRoot.querySelector( + 'c-quantic-search-box' + ); + + expect(searchBox).not.toBeNull(); + expect(searchBox.keepFiltersOnSearch).toEqual(false); + }); + }); + describe('when keepFiltersOnSearch is false (default)', () => { it('should properly initialize the controller with clear filters enabled', async () => { createTestComponent();