-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
x-pack/plugins/ingest_manager/server/services/saved_object.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { escapeSearchQueryPhrase } from './saved_object'; | ||
|
||
describe('Saved object service', () => { | ||
describe('escapeSearchQueryPhrase', () => { | ||
it('should return value between quotes', () => { | ||
const res = escapeSearchQueryPhrase('-test'); | ||
|
||
expect(res).toEqual('"-test"'); | ||
}); | ||
|
||
it('should escape quotes', () => { | ||
const res = escapeSearchQueryPhrase('test1"test2'); | ||
|
||
expect(res).toEqual(`"test1\"test2"`); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters