mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 22:15:45 +01:00
Fix encoding in global search (#2116)
Using plus symbol in global search led to a space in the query parameter of the URL. We now encode the query string properly in global search and additionally fixed the expert search documentation.
This commit is contained in:
committed by
GitHub
parent
30e26b8d4e
commit
54b7b96ac8
@@ -98,6 +98,16 @@ describe("tests for getQueryStringFromLocation", () => {
|
||||
expect(getQueryStringFromLocation(location)).toBe("abc");
|
||||
});
|
||||
|
||||
it("should return the query string with a space instead of a plus symbol", () => {
|
||||
const location = createLocation("?q=+(Test)");
|
||||
expect(getQueryStringFromLocation(location)).toBe(" (Test)");
|
||||
});
|
||||
|
||||
it("should return the query string with a plus symbol", () => {
|
||||
const location = createLocation("?q=%2B(Test)");
|
||||
expect(getQueryStringFromLocation(location)).toBe("+(Test)");
|
||||
});
|
||||
|
||||
it("should return query string from multiple parameters", () => {
|
||||
const location = createLocation("?x=a&y=b&q=abc&z=c");
|
||||
expect(getQueryStringFromLocation(location)).toBe("abc");
|
||||
|
||||
Reference in New Issue
Block a user