1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { initialDataExplorer } from '../data-explorer/data-explorer-reducer'
6 import { getParams } from './search-results-middleware-service'
8 describe('search-results-middleware', () => {
9 describe('getParams', () => {
10 it('should use include_old_versions=true when asked', () => {
11 const dataExplorer = initialDataExplorer;
12 const query = 'Search term is:pastVersion';
13 const apiRev = 20201013;
14 const params = getParams(dataExplorer, query, apiRev);
15 expect(params.includeOldVersions).toBe(true);
18 it('should not use include_old_versions=true when not asked', () => {
19 const dataExplorer = initialDataExplorer;
20 const query = 'Search term';
21 const apiRev = 20201013;
22 const params = getParams(dataExplorer, query, apiRev);
23 expect(params.includeOldVersions).toBe(false);