Bug 2012474 - Persist the project search exclude patterns as they are edited. r?bomsy

This commit is contained in:
dualfroz committed 2026-10-11 23:42:27 +02:00
1 parent 35563aaab9
commit afb7e05d7b
2 files changed
+85 -7

No files matched your search

@@ -274,6 +274,59 @@ add_task(async function testSearchExcludePatterns() {
pressKey(dbg, "Enter");
});
add_task(async function testClearedExcludePatternsAreNotKept() {
const dbg = await initDebugger("doc-react.html", "App.js");
await openProjectSearch(dbg);
await doProjectSearch(dbg, "console", 5);
info("Exclude the node_modules files");
await clickElement(dbg, "excludePatternsInput");
type(dbg, "**/node_modules/**");
pressKey(dbg, "Enter");
await waitForSearchResults(dbg, 2);
info("Clear the exclude input and blur it without pressing Enter");
await clearElement(dbg, "excludePatternsInput");
await clickElement(dbg, "projectSearchSearchInput");
await waitForState(
dbg,
() =>
dbg.selectors.getSearchOptions("project-search").excludePatterns === "",
"The cleared exclude pattern is stored"
);
info("Re-trigger the search from the search input");
pressKey(dbg, "Enter");
const fileResults = await waitForSearchResults(dbg, 5);
const resultsFromNodeModules = [...fileResults].filter(result =>
result.innerText.includes("node_modules")
);
is(
resultsFromNodeModules.length,
3,
"Results from node_modules are no longer excluded"
);
info("Close and reopen the debugger");
await dbg.toolbox.closeToolbox();
const toolbox = await openToolboxForTab(gBrowser.selectedTab, "jsdebugger");
const dbg2 = createDebuggerContext(toolbox);
await openProjectSearch(dbg2);
const excludePatternsInputElement = await waitForElement(
dbg2,
"excludePatternsInput"
);
is(
excludePatternsInputElement.value,
"",
"The exclude input is still empty after reopening the debugger"
);
await clearElement(dbg2, "projectSearchSearchInput");
});
async function assertProjectSearchModifier(
dbg,
searchModifierBtn,