Change fuzzy search to search all namespaces
Thanks to @apollo13 for reporting this in #10101.
This commit is contained in:
parent
e618c06076
commit
14bd99196a
|
@ -46,6 +46,7 @@ export default class GlobalSearchControl extends Component {
|
|||
body: JSON.stringify({
|
||||
Text: string,
|
||||
Context: 'all',
|
||||
Namespace: '*',
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
|
@ -83,11 +83,21 @@ module('Acceptance | search', function(hooks) {
|
|||
await Layout.navbar.search.groups[4].options[0].click();
|
||||
assert.equal(currentURL(), '/csi/plugins/xyz-plugin');
|
||||
|
||||
const featureDetectionQueries = server.pretender.handledRequests
|
||||
.filterBy('url', '/v1/search/fuzzy')
|
||||
const fuzzySearchQueries = server.pretender.handledRequests
|
||||
.filterBy('url', '/v1/search/fuzzy');
|
||||
|
||||
const featureDetectionQueries = fuzzySearchQueries
|
||||
.filter(request => request.requestBody.includes('feature-detection-query'));
|
||||
|
||||
assert.equal(featureDetectionQueries.length, 1, 'expect the feature detection query to only run once');
|
||||
assert.ok(featureDetectionQueries.length, 1, 'expect the feature detection query to only run once');
|
||||
|
||||
const realFuzzySearchQuery = fuzzySearchQueries[1];
|
||||
|
||||
assert.deepEqual(JSON.parse(realFuzzySearchQuery.requestBody), {
|
||||
'Context': 'all',
|
||||
'Namespace': '*',
|
||||
'Text': 'xy'
|
||||
});
|
||||
});
|
||||
|
||||
test('search does not perform a request when only one character has been entered', async function(assert) {
|
||||
|
|
Loading…
Reference in a new issue