21700: Install Bundler system-wide in Rails postinst
[arvados.git] / services / workbench2 / src / store / search-results-panel / search-results-middleware-service.test.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { initialDataExplorer } from '../data-explorer/data-explorer-reducer'
6 import { getParams } from './search-results-middleware-service'
7
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);
16         });
17
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);
24         });
25     })
26 })