зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1367318 - Trim console filter input. r=Honza
MozReview-Commit-ID: 8OAEUh6ekiP --HG-- extra : rebase_source : 9daae96d601fa1404210a59a7f947ac6ad1f62fe
This commit is contained in:
Родитель
d00da488bb
Коммит
49c34bcec9
|
@ -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", () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче