[ARVADOS-WORKBENCH2] updated: 1.4.1-473-g25205bf0

Git user git at public.arvados.org
Tue Oct 13 15:23:44 UTC 2020


Summary of changes:
 .../search-results-middleware-service.test.ts      | 26 ++++++++++++++++++++++
 .../search-results-middleware-service.ts           |  2 +-
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 src/store/search-results-panel/search-results-middleware-service.test.ts

       via  25205bf097b26337cfed1457577161174da8b91e (commit)
      from  1d4e548cf6c8f11d939712ea5f4df06786a89d64 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 25205bf097b26337cfed1457577161174da8b91e
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Tue Oct 13 12:23:11 2020 -0300

    16718: Adds tests for include_old_version usage on search middleware.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/search-results-panel/search-results-middleware-service.test.ts b/src/store/search-results-panel/search-results-middleware-service.test.ts
new file mode 100644
index 00000000..34b78809
--- /dev/null
+++ b/src/store/search-results-panel/search-results-middleware-service.test.ts
@@ -0,0 +1,26 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { initialDataExplorer } from '../data-explorer/data-explorer-reducer'
+import { getParams } from './search-results-middleware-service'
+
+describe('search-results-middleware', () => {
+    describe('getParams', () => {
+        it('should use include_old_versions=true when asked', () => {
+            const dataExplorer = initialDataExplorer;
+            const query = 'Search term is:pastVersion';
+            const apiRev = 20201013;
+            const params = getParams(dataExplorer, query, apiRev);
+            expect(params.includeOldVersions).toBe(true);
+        });
+
+        it('should not use include_old_versions=true when not asked', () => {
+            const dataExplorer = initialDataExplorer;
+            const query = 'Search term';
+            const apiRev = 20201013;
+            const params = getParams(dataExplorer, query, apiRev);
+            expect(params.includeOldVersions).toBe(false);
+        });
+    })
+})
\ No newline at end of file
diff --git a/src/store/search-results-panel/search-results-middleware-service.ts b/src/store/search-results-panel/search-results-middleware-service.ts
index 6d2dce7c..9aa49c28 100644
--- a/src/store/search-results-panel/search-results-middleware-service.ts
+++ b/src/store/search-results-panel/search-results-middleware-service.ts
@@ -70,7 +70,7 @@ export class SearchResultsMiddlewareService extends DataExplorerMiddlewareServic
 
 const typeFilters = (columns: DataColumns<string>) => serializeResourceTypeFilters(getDataExplorerColumnFilters(columns, ProjectPanelColumnNames.TYPE));
 
-const getParams = (dataExplorer: DataExplorer, query: string, apiRevision: number) => ({
+export const getParams = (dataExplorer: DataExplorer, query: string, apiRevision: number) => ({
     ...dataExplorerToListParams(dataExplorer),
     filters: joinFilters(
         queryToFilters(query, apiRevision),

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list