-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: [UIE-8440] - Allow more symbols to be used in Search v2 (#11616)
Co-authored-by: Banks Nussman <[email protected]>
- Loading branch information
1 parent
bd79814
commit 33143b1
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -165,6 +165,39 @@ describe("getAPIFilterFromQuery", () => { | |
}); | ||
}); | ||
|
||
it("allows '@' symbol in search", () => { | ||
const query = 'email: [email protected]'; | ||
|
||
expect(getAPIFilterFromQuery(query, { searchableFieldsWithoutOperator: [] })).toEqual({ | ||
filter: { | ||
email: { '+contains': "[email protected]" } | ||
}, | ||
error: null, | ||
}); | ||
}); | ||
|
||
it("allows '-' symbol in search", () => { | ||
const query = 'username: test-user-1'; | ||
|
||
expect(getAPIFilterFromQuery(query, { searchableFieldsWithoutOperator: [] })).toEqual({ | ||
filter: { | ||
username: { '+contains': "test-user-1" } | ||
}, | ||
error: null, | ||
}); | ||
}); | ||
|
||
it("allows '_' symbol in search", () => { | ||
const query = 'username: test_user_1'; | ||
|
||
expect(getAPIFilterFromQuery(query, { searchableFieldsWithoutOperator: [] })).toEqual({ | ||
filter: { | ||
username: { '+contains': "test_user_1" } | ||
}, | ||
error: null, | ||
}); | ||
}); | ||
|
||
it("allows a quoted string so you can use spaces in the query (single quotes)", () => { | ||
const query = "label: 'my stackscript' and username = linode"; | ||
|
||
|