feat(sidebar+assistant): filtre Recents/Sauvegardes (#99), pastille Deep Research (#100) et icone du bouton + (BUG-049)
This commit is contained in:
@@ -1908,6 +1908,31 @@ async function main() {
|
||||
b._panel.remove();
|
||||
});
|
||||
|
||||
await test("ext menu Deep Research adds a chip instead of composer text", async () => {
|
||||
localStorage.clear();
|
||||
document.body.replaceChildren();
|
||||
const b = new BooksLM();
|
||||
b._panel = b._render();
|
||||
document.body.appendChild(b._panel);
|
||||
const ta = b._panel.querySelector("textarea");
|
||||
ta.value = "";
|
||||
b._toggleExtMenu();
|
||||
const btn = b._panel.querySelector('.bookslm-ext-item[data-ext-id="deep_research"]');
|
||||
assert.ok(btn, "Deep Research entry present in the + panel");
|
||||
btn.click();
|
||||
await sleep(20);
|
||||
const chip = b._panel.querySelector(".bookslm-chip-deep-research");
|
||||
assert.ok(chip, "a Deep Research chip is added");
|
||||
assert.equal(ta.value, "", "the composer stays empty (no injected directive)");
|
||||
assert.equal(b._activeDeepResearch, true, "the deep-research flag is set");
|
||||
// Removing the chip clears the flag.
|
||||
chip.querySelector(".bookslm-chip-remove").click();
|
||||
assert.ok(!b._panel.querySelector(".bookslm-chip-deep-research"), "the chip is removed");
|
||||
assert.equal(b._activeDeepResearch, false, "the flag is cleared with the chip");
|
||||
b._panel.remove();
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
// ── Summary ──
|
||||
console.log(`\n${passCount}/${testCount} tests passed`);
|
||||
if (passCount !== testCount) {
|
||||
|
||||
Reference in New Issue
Block a user