Bug 1367318 - Trim console filter input. r=Honza

MozReview-Commit-ID: 8OAEUh6ekiP

--HG--
extra : rebase_source : 9daae96d601fa1404210a59a7f947ac6ad1f62fe
This commit is contained in:
Nicolas Chevobbe 2017-06-02 09:52:27 +02:00
Родитель d00da488bb
Коммит 49c34bcec9
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -395,7 +395,7 @@ function matchCssFilters(message, filters) {
}
function matchSearchFilters(message, filters) {
let text = filters.text || "";
let text = (filters.text || "").trim();
return (
text === ""
// Look for a match in parameters.

Просмотреть файл

@ -100,10 +100,20 @@ describe("Filtering", () => {
});
describe("Text filter", () => {
it("set the expected property on the store", () => {
store.dispatch(actions.filterTextSet("danger"));
expect(getAllFilters(store.getState()).text).toEqual("danger");
});
it("matches on value grips", () => {
store.dispatch(actions.filterTextSet("danger"));
let messages = getVisibleMessages(store.getState());
expect(messages.length - numUnfilterableMessages).toEqual(1);
// Checks that trimming works.
store.dispatch(actions.filterTextSet(" danger "));
messages = getVisibleMessages(store.getState());
expect(messages.length - numUnfilterableMessages).toEqual(1);
});
it("matches unicode values", () => {