fix(hub): tests follow requirement 030 and the line comments, dead ask answer path removed
🧪 Test / 🧪 Lock + lint (push) Waiting to run
🧪 Test / 🧪 Lock + lint (push) Waiting to run
Requirement 030 answers a permission ask with Grant and Deny only, so the ask branch of choiceOf, answerAsk, askDialog, ALLOW and TELL had no caller left; they are removed. test_ask_answers_e2e now denies one ask with Deny and one through Deny via with a typed reason, both by post to the requester; test_stream_keeps_typing_e2e types into a named-option decision while an ask keeps its diff scroll. The grant-mode and inbox-gone harnesses load page-diff.js (and page-deny.js) instead of missing lineNotes, the slash marker test names the new Comment field, and the line-comment e2e expect the requester and radio commands the hub really sends. The help line no longer reads as an agent calling an agent and uses an ASCII minus for the zoom keys. Evidence: tests/e2e 146 OK, make test 2123 OK with ruff, shellcheck and markdownlint clean, MEDUSA 100 % over 624729d..this tree. 🎯 Fix: 96 % 💥 Break: 2 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 94 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2722cda1b5
commit
d3bc54f401
11 files changed
+45
-44
No files matched your search
@@ -75,7 +75,7 @@
|
|||||||
direct: [[740, 0, 0.2]],
|
direct: [[740, 0, 0.2]],
|
||||||
radio: [[520, 0, 0.07]],
|
radio: [[520, 0, 0.07]],
|
||||||
};
|
};
|
||||||
const KEYS = [["Ctrl+K", "Commands, views, agents and AI command"], ["Right-click", "Context menu: the element's commands, then the tab's, then the general ones"], ["Shift+right-click", "The browser's own context menu"], ["Menu key · Shift+F10", "Context menu of the focused element: ↑ / ↓ move, Enter runs, Esc closes"], ["1 · 2 · 3 · 4", "Stream · Agents · Artifacts · Tasks"], ["j / k", "Waits on Operator: next / previous entry"], ["x", "Waits on Operator: select entry"], ["a", "Waits on Operator: grant entry (3 s to undo)"], ["Enter", "Waits on Operator: open entry"], ["f", "Comment on the selected lines of a diff or a command: it goes with Deny as a call, or after Grant as a post"], ["→ · ← · ↑", "Match: accept · reject with feedback · later"],["/", "Search the stream"], ["h", "Look at the sky: drag turns the view, wheel or two fingers zoom, Esc ends"], ["Arrows · + / − · 0", "Sky (focused): turn · zoom · reset"], ["Drag · wheel", "3D: turn, right drag pans, wheel zooms"], ["+ / − · 0 · Ctrl+wheel", "Home tile (focused): zoom its content in · out · reset"],["🎙 hold", "Voice input into the agent field or the command line, never sent automatically"], ["?", "This help"], ["Esc", "Close"]];
|
const KEYS = [["Ctrl+K", "Commands, views, agents and AI command"], ["Right-click", "Context menu: the element's commands, then the tab's, then the general ones"], ["Shift+right-click", "The browser's own context menu"], ["Menu key · Shift+F10", "Context menu of the focused element: ↑ / ↓ move, Enter runs, Esc closes"], ["1 · 2 · 3 · 4", "Stream · Agents · Artifacts · Tasks"], ["j / k", "Waits on Operator: next / previous entry"], ["x", "Waits on Operator: select entry"], ["a", "Waits on Operator: grant entry (3 s to undo)"], ["Enter", "Waits on Operator: open entry"], ["f", "Comment on the selected lines of a diff or a command; Deny or Grant sends the comments"], ["→ · ← · ↑", "Match: accept · reject with feedback · later"],["/", "Search the stream"], ["h", "Look at the sky: drag turns the view, wheel or two fingers zoom, Esc ends"], ["Arrows · + / - · 0", "Sky (focused): turn · zoom · reset"], ["Drag · wheel", "3D: turn, right drag pans, wheel zooms"], ["+ / - · 0 · Ctrl+wheel", "Home tile (focused): zoom its content in · out · reset"],["🎙 hold", "Voice input into the agent field or the command line, never sent automatically"], ["?", "This help"], ["Esc", "Close"]];
|
||||||
const calm = window.matchMedia("(prefers-reduced-motion: reduce)");
|
const calm = window.matchMedia("(prefers-reduced-motion: reduce)");
|
||||||
const relative = new Intl.RelativeTimeFormat("en", {numeric: "auto"});
|
const relative = new Intl.RelativeTimeFormat("en", {numeric: "auto"});
|
||||||
const absolute = new Intl.DateTimeFormat("en-GB", {dateStyle: "medium", timeStyle: "short"});
|
const absolute = new Intl.DateTimeFormat("en-GB", {dateStyle: "medium", timeStyle: "short"});
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
const OTHER_PROMPT = "Other: type your own answer …";
|
const OTHER_PROMPT = "Other: type your own answer …";
|
||||||
const ALLOW = "Yes";
|
|
||||||
const TELL = "Tell Claude what to do instead";
|
|
||||||
const askDialog = (id) => ({id, options: [{label: ALLOW, description: "allow this one call"}, {label: "No", description: "deny it"}], recommended: "", multi: false});
|
|
||||||
const drafts = new Map();
|
const drafts = new Map();
|
||||||
const forgetDraft = (id) => drafts.delete(id);
|
const forgetDraft = (id) => drafts.delete(id);
|
||||||
|
|
||||||
|
|||||||
@@ -154,13 +154,6 @@
|
|||||||
|
|
||||||
const signsFor = (item) => `${item.agent} gets this answer as a call once your passkey signs it`;
|
const signsFor = (item) => `${item.agent} gets this answer as a call once your passkey signs it`;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {Object} item a permission ask.
|
|
||||||
* @param {string} answer the picked label, or the typed text.
|
|
||||||
* @param {boolean} typed whether answer is typed text, which always denies with it as the reason.
|
|
||||||
*/
|
|
||||||
const answerAsk = (item, answer, typed) => (!typed && answer === ALLOW ? approveOne(item) : denyNow(item, lineNotes(keyOf(item)) ? "call" : "post", withNotes(item, typed ? answer : ""), item.to));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} item an inbox item.
|
* @param {Object} item an inbox item.
|
||||||
* @param {Function} after called before a picked answer is sent.
|
* @param {Function} after called before a picked answer is sent.
|
||||||
@@ -174,9 +167,6 @@
|
|||||||
if (item.kind === "decision") {
|
if (item.kind === "decision") {
|
||||||
return choiceDialog(item, {pick: (label) => { after(); chooseOne(item, label); }, toggled: new Set(), chosen: ui.selected.has(keyOf(item)) ? grantLabel(item) : "", locked: item.held, hint: signsFor(item), group: "", other: OTHER_PROMPT});
|
return choiceDialog(item, {pick: (label) => { after(); chooseOne(item, label); }, toggled: new Set(), chosen: ui.selected.has(keyOf(item)) ? grantLabel(item) : "", locked: item.held, hint: signsFor(item), group: "", other: OTHER_PROMPT});
|
||||||
}
|
}
|
||||||
if (item.kind === "ask") {
|
|
||||||
return choiceDialog(askDialog(item.id), {pick: (answer, typed) => { after(); answerAsk(item, answer, typed); }, toggled: new Set(), chosen: ui.selected.has(keyOf(item)) ? ALLOW : "", locked: item.held, hint: `the answer goes to ${item.to || "its session"} once your passkey signs it`, group: "", other: TELL});
|
|
||||||
}
|
|
||||||
const shown = ui.selected.has(keyOf(item)) ? grantLabel(item) : "";
|
const shown = ui.selected.has(keyOf(item)) ? grantLabel(item) : "";
|
||||||
return asked(item) ? [answerTo(item), choiceDialog(item, {pick: (label) => { after(); answerPick(item, label); }, toggled: new Set(), chosen: shown, locked: item.held, hint: signsFor(item), group: "", other: OTHER_PROMPT})] : null;
|
return asked(item) ? [answerTo(item), choiceDialog(item, {pick: (label) => { after(); answerPick(item, label); }, toggled: new Set(), chosen: shown, locked: item.held, hint: signsFor(item), group: "", other: OTHER_PROMPT})] : null;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,18 +18,25 @@ from kvb_orchestrator import batches, skill_scripts
|
|||||||
|
|
||||||
TYPED = "run make test first"
|
TYPED = "run make test first"
|
||||||
ANSWER = """(async () => {@HELPERS@
|
ANSWER = """(async () => {@HELPERS@
|
||||||
const row = await until(() => all("#main .inbox-list > li").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".options button.option")), 10000);
|
const row = await until(() => all("#main .inbox-list > li").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".deny-split")), 10000);
|
||||||
if (!row) {
|
if (!row) {
|
||||||
return {error: text(document.getElementById("main"))};
|
return {error: text(document.getElementById("main"))};
|
||||||
}
|
}
|
||||||
const shown = new Set(all("#toasts .toast"));
|
const shown = new Set(all("#toasts .toast"));
|
||||||
|
const options = all(".options button.option", row).length;
|
||||||
if (@TYPED@) {
|
if (@TYPED@) {
|
||||||
row.querySelector(".option.other input").value = @TYPED@;
|
all(".deny-split button", row).find((button) => name(button) === "Deny via …").click();
|
||||||
row.querySelector(".option.other button[type=submit]").click();
|
const reason = await until(() => document.querySelector(".sheet-box .deny-reason textarea"), 4000);
|
||||||
|
if (!reason) {
|
||||||
|
return {error: "no Deny via sheet"};
|
||||||
|
}
|
||||||
|
reason.value = @TYPED@;
|
||||||
|
document.querySelector('.sheet-box .deny-channels input[value="post"]').click();
|
||||||
|
all(".sheet-box .actions button").find((button) => text(button) === "Deny").click();
|
||||||
} else {
|
} else {
|
||||||
all(".options button.option", row).find((option) => text(option.querySelector("strong")) === "No").click();
|
all(".deny-split button", row).find((button) => name(button) === "Deny").click();
|
||||||
}
|
}
|
||||||
return {toast: await until(() => all("#toasts .toast").filter((box) => !shown.has(box)).map(text).find((entry) => entry.startsWith("Denial")), 20000)};
|
return {options, toast: await until(() => all("#toasts .toast").filter((box) => !shown.has(box)).map(text).find((entry) => entry.startsWith("Denial")), 20000)};
|
||||||
})()"""
|
})()"""
|
||||||
|
|
||||||
|
|
||||||
@@ -39,20 +46,21 @@ class TestAskAnswers(base.OrchestratorE2ECase):
|
|||||||
script = ANSWER.replace("@HELPERS@", base.HELPERS).replace("@COMMAND@", json.dumps(command)).replace("@TYPED@", json.dumps(typed))
|
script = ANSWER.replace("@HELPERS@", base.HELPERS).replace("@COMMAND@", json.dumps(command)).replace("@TYPED@", json.dumps(typed))
|
||||||
return {"width": 1366, "height": 768, "url": f"http://localhost:{self.port}/#stream/inbox", "wait": 1200, "probe": script, "shot": self.shot(f"1366-ask-answer-{'typed' if typed else 'no'}")}
|
return {"width": 1366, "height": 768, "url": f"http://localhost:{self.port}/#stream/inbox", "wait": 1200, "probe": script, "shot": self.shot(f"1366-ask-answer-{'typed' if typed else 'no'}")}
|
||||||
|
|
||||||
def test_chromium_no_and_a_typed_answer_deny_the_ask_and_tell_its_requester(self):
|
def test_chromium_deny_and_deny_via_with_a_reason_deny_the_boolean_ask_and_tell_its_requester(self):
|
||||||
self.create_ask({**ASK, "command": "make clean", "timeout": 3600})
|
self.create_ask({**ASK, "command": "make clean", "timeout": 3600})
|
||||||
with mock.patch.object(batches, "UNDO", 0.3):
|
with mock.patch.object(batches, "UNDO", 0.3):
|
||||||
data = self.drive([self.step("make deploy", ""), self.step("make clean", TYPED)], self.authenticator())
|
data = self.drive([self.step("make deploy", ""), self.step("make clean", TYPED)], self.authenticator())
|
||||||
|
(OUT / "chromium-ask-answers.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
|
||||||
|
for found in data["results"]:
|
||||||
|
self.assertNotIn("error", found, found)
|
||||||
|
self.assertEqual(found["options"], 0, found)
|
||||||
|
self.assertTrue(found["toast"].startswith("Denial (Post): Bash: make"), found)
|
||||||
self.settle(lambda: all(ask["status"] == "denied" for ask in self.httpd.hub.asks.listed()))
|
self.settle(lambda: all(ask["status"] == "denied" for ask in self.httpd.hub.asks.listed()))
|
||||||
(OUT / "chromium-ask-answers.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
|
|
||||||
self.assertEqual([error for error in data["errors"] if "(style-src-elem)" not in error and "/favicon.ico" not in error], [])
|
self.assertEqual([error for error in data["errors"] if "(style-src-elem)" not in error and "/favicon.ico" not in error], [])
|
||||||
for found in data["results"]:
|
|
||||||
self.assertNotIn("error", found, found)
|
|
||||||
self.assertTrue(found["toast"].startswith("Denial (Post): Bash: make"), found)
|
|
||||||
asks = {ask["command"]: (ask["status"], ask["channel"], ask["reason"]) for ask in self.httpd.hub.asks.listed()}
|
asks = {ask["command"]: (ask["status"], ask["channel"], ask["reason"]) for ask in self.httpd.hub.asks.listed()}
|
||||||
self.assertEqual(asks, {"make deploy": ("denied", "post", ""), "make clean": ("denied", "post", TYPED)})
|
self.assertEqual(asks, {"make deploy": ("denied", "post", ""), "make clean": ("denied", "post", TYPED)})
|
||||||
radio = [args for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
radio = [args for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
||||||
self.assertEqual([args[:4] for args in radio], [["send", "post", "--to", "Skills session"]] * 2)
|
self.assertEqual([args[:3] for args in radio], [["post", "--to", "Skills session"]] * 2)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class TestLineComments(base.OrchestratorE2ECase):
|
|||||||
self.assertNotIn("error", stream, stream)
|
self.assertNotIn("error", stream, stream)
|
||||||
self.assertEqual((stream["item"], stream["sheet"]), ("Comment", {"title": "Comment", "range": "a.txt:2", "unlabelled": []}))
|
self.assertEqual((stream["item"], stream["sheet"]), ("Comment", {"title": "Comment", "range": "a.txt:2", "unlabelled": []}))
|
||||||
self.assertEqual(stream["marked"], {"rows": ["2", "2"], "notes": ["stream note"], "list": ["a.txt:2stream note"], "open": False})
|
self.assertEqual(stream["marked"], {"rows": ["2", "2"], "notes": ["stream note"], "list": ["a.txt:2stream note"], "open": False})
|
||||||
self.assertEqual(stream["deny"], {"reason": "a.txt:2: stream note", "channel": "call", "to": "Skills session"})
|
self.assertEqual(stream["deny"], {"reason": "a.txt:2: stream note", "channel": "call", "to": "Skills"})
|
||||||
denial = [["ask", "reject", "call", "a.txt:2: stream note"]]
|
denial = [["ask", "reject", "call", "a.txt:2: stream note"]]
|
||||||
self.assertEqual(stream["posted"], [["/api/sign", None, denial], *([["/api/inbox/approve", None, denial]] if signs else [])])
|
self.assertEqual(stream["posted"], [["/api/sign", None, denial], *([["/api/inbox/approve", None, denial]] if signs else [])])
|
||||||
self.assertNotIn("error", overlay, overlay)
|
self.assertNotIn("error", overlay, overlay)
|
||||||
@@ -159,7 +159,7 @@ class TestLineComments(base.OrchestratorE2ECase):
|
|||||||
asks = [(ask["status"], ask.get("channel", ""), ask.get("reason", "")) for ask in self.httpd.hub.asks.listed() if ask["command"] == COMMAND]
|
asks = [(ask["status"], ask.get("channel", ""), ask.get("reason", "")) for ask in self.httpd.hub.asks.listed() if ask["command"] == COMMAND]
|
||||||
self.assertEqual(asks, [("denied", "call", "a.txt:2: stream note")])
|
self.assertEqual(asks, [("denied", "call", "a.txt:2: stream note")])
|
||||||
radio = [" ".join(args) for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
radio = [" ".join(args) for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
||||||
self.assertEqual(len([entry for entry in radio if entry.startswith("send post --to Skills session ") and f"Granted: {TITLE}. Notes:" in entry and "src/app.py:3: overlay note" in entry]), 1, radio)
|
self.assertEqual(len([entry for entry in radio if entry.startswith("post --to ") and f"Granted: {TITLE}. Notes:" in entry and "src/app.py:3: overlay note" in entry]), 1, radio)
|
||||||
|
|
||||||
@unittest.skipUnless(shutil.which(os.environ.get("FIREFOX", "firefox")), "no Firefox")
|
@unittest.skipUnless(shutil.which(os.environ.get("FIREFOX", "firefox")), "no Firefox")
|
||||||
def test_firefox_keeps_line_comments_when_the_deny_and_the_grant_go_unsigned(self):
|
def test_firefox_keeps_line_comments_when_the_deny_and_the_grant_go_unsigned(self):
|
||||||
|
|||||||
@@ -13,22 +13,26 @@ sys.path[:0] = [str(HERE.parent), str(HERE)]
|
|||||||
|
|
||||||
import hub_e2e_kit as base
|
import hub_e2e_kit as base
|
||||||
from hub_case import HubCase
|
from hub_case import HubCase
|
||||||
from hub_support import ASK, iso
|
from hub_support import ASK, OPTIONS, iso
|
||||||
|
|
||||||
OUT = Path(os.environ.get("E2E_OUT", "/tmp/hub-stream-keep-shots"))
|
OUT = Path(os.environ.get("E2E_OUT", "/tmp/hub-stream-keep-shots"))
|
||||||
COMMAND = "git commit -m 'stream keeps typing'"
|
COMMAND = "git commit -m 'stream keeps typing'"
|
||||||
|
QUESTION = "Merge the stream fix?"
|
||||||
TYPED = "rebase onto main first"
|
TYPED = "rebase onto main first"
|
||||||
LINES = 300
|
LINES = 300
|
||||||
DIFF = [{"path": "long.txt", "status": "M", "mode": "100644", "additions": LINES, "deletions": 0, "patch": f"@@ -0,0 +1,{LINES} @@\n" + "\n".join(f"+line {n}" for n in range(LINES)), "note": ""}]
|
DIFF = [{"path": "long.txt", "status": "M", "mode": "100644", "additions": LINES, "deletions": 0, "patch": f"@@ -0,0 +1,{LINES} @@\n" + "\n".join(f"+line {n}" for n in range(LINES)), "note": ""}]
|
||||||
PROBE = """(async () => {@HELPERS@
|
PROBE = """(async () => {@HELPERS@
|
||||||
const rowOf = () => all("#main .feed > li.k-ask").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".diff-scroll") && li.querySelector(".option.other input"));
|
const askOf = () => all("#main .feed > li.k-ask").find((li) => li.textContent.includes(@COMMAND@) && li.querySelector(".diff-scroll"));
|
||||||
const row = await until(rowOf, 10000);
|
const choiceOf = () => all("#main .feed > li.k-decision").find((li) => li.textContent.includes(@QUESTION@) && li.querySelector(".option.other input"));
|
||||||
if (!row) {
|
const rows = await until(() => (askOf() && choiceOf() ? [askOf(), choiceOf()] : null), 10000);
|
||||||
|
if (!rows) {
|
||||||
return {error: text(document.getElementById("main"))};
|
return {error: text(document.getElementById("main"))};
|
||||||
}
|
}
|
||||||
row.dataset.probe = "old";
|
const [ask, choice] = rows;
|
||||||
const scroller = row.querySelector(".diff-scroll");
|
ask.dataset.probe = "old";
|
||||||
const field = row.querySelector(".option.other input");
|
choice.dataset.probe = "old";
|
||||||
|
const scroller = ask.querySelector(".diff-scroll");
|
||||||
|
const field = choice.querySelector(".option.other input");
|
||||||
scroller.scrollTop = 200;
|
scroller.scrollTop = 200;
|
||||||
field.focus();
|
field.focus();
|
||||||
field.value = @TYPED@;
|
field.value = @TYPED@;
|
||||||
@@ -36,14 +40,14 @@ PROBE = """(async () => {@HELPERS@
|
|||||||
field.setSelectionRange(6, 6);
|
field.setSelectionRange(6, 6);
|
||||||
const top = scroller.scrollTop;
|
const top = scroller.scrollTop;
|
||||||
const redrawn = await until(() => {
|
const redrawn = await until(() => {
|
||||||
const now = rowOf();
|
const [now, typed] = [askOf(), choiceOf()];
|
||||||
return now && now.dataset.probe !== "old" ? now : null;
|
return now && typed && now.dataset.probe !== "old" && typed.dataset.probe !== "old" ? [now, typed] : null;
|
||||||
}, 15000);
|
}, 15000);
|
||||||
if (!redrawn) {
|
if (!redrawn) {
|
||||||
return {error: "the stream never redrew", top};
|
return {error: "the stream never redrew", top};
|
||||||
}
|
}
|
||||||
const again = redrawn.querySelector(".option.other input");
|
const again = redrawn[1].querySelector(".option.other input");
|
||||||
return {top, after: redrawn.querySelector(".diff-scroll").scrollTop, focused: document.activeElement === again, value: again.value, caret: [again.selectionStart, again.selectionEnd]};
|
return {top, after: redrawn[0].querySelector(".diff-scroll").scrollTop, focused: document.activeElement === again, value: again.value, caret: [again.selectionStart, again.selectionEnd]};
|
||||||
})()"""
|
})()"""
|
||||||
|
|
||||||
|
|
||||||
@@ -56,10 +60,12 @@ class TestStreamKeepsTyping(HubCase):
|
|||||||
self.write_council({"work/s1/claim.json": {"office": "work/s1", "session": "s1", "runtime": "claude", "name": "Skills session", "since": iso(now - 86400), "beat": now, "work": "stream"}})
|
self.write_council({"work/s1/claim.json": {"office": "work/s1", "session": "s1", "runtime": "claude", "name": "Skills session", "since": iso(now - 86400), "beat": now, "work": "stream"}})
|
||||||
status, _, body = self.post_json("/api/asks", {**ASK, "command": COMMAND, "session": "s1", "diff": DIFF}, self.local())
|
status, _, body = self.post_json("/api/asks", {**ASK, "command": COMMAND, "session": "s1", "diff": DIFF}, self.local())
|
||||||
self.assertEqual(status, 201, body)
|
self.assertEqual(status, 201, body)
|
||||||
|
decided = self.tool("decision_request", {"question": QUESTION, "options": OPTIONS, "agent": "Skills session", "recommended": ""})
|
||||||
|
self.assertFalse(decided["isError"], decided)
|
||||||
OUT.mkdir(parents=True, exist_ok=True)
|
OUT.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
def check(self, browser: str, driver: str, binary: str) -> None:
|
def check(self, browser: str, driver: str, binary: str) -> None:
|
||||||
script = PROBE.replace("@HELPERS@", base.HELPERS).replace("@COMMAND@", json.dumps(COMMAND)).replace("@TYPED@", json.dumps(TYPED))
|
script = PROBE.replace("@HELPERS@", base.HELPERS).replace("@COMMAND@", json.dumps(COMMAND)).replace("@QUESTION@", json.dumps(QUESTION)).replace("@TYPED@", json.dumps(TYPED))
|
||||||
steps = [{"width": 1366, "height": 768, "url": f"http://localhost:{self.port}/?1366#stream", "wait": 1500, "probe": script, "shot": str(OUT / f"{browser}-1366-stream.png")}]
|
steps = [{"width": 1366, "height": 768, "url": f"http://localhost:{self.port}/?1366#stream", "wait": 1500, "probe": script, "shot": str(OUT / f"{browser}-1366-stream.png")}]
|
||||||
data = self.drive(steps, None, driver, binary)
|
data = self.drive(steps, None, driver, binary)
|
||||||
(OUT / f"{browser}-stream.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
|
(OUT / f"{browser}-stream.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class TestWidgetZoom(base.OrchestratorE2ECase):
|
|||||||
self.assertEqual((keys["stored"], kept["zoom"]), (130, 130), (keys, kept))
|
self.assertEqual((keys["stored"], kept["zoom"]), (130, 130), (keys, kept))
|
||||||
self.assertEqual(menu["labels"], ["Zoom in", "Zoom out", "Reset zoom (130 %)"], menu)
|
self.assertEqual(menu["labels"], ["Zoom in", "Zoom out", "Reset zoom (130 %)"], menu)
|
||||||
self.assertEqual((menu["out"], menu["back"], menu["reset"]), (120, 130, 100), menu)
|
self.assertEqual((menu["out"], menu["back"], menu["reset"]), (120, 130, 100), menu)
|
||||||
self.assertIn("+ / − · 0 · Ctrl+wheel", shown["keys"], shown)
|
self.assertIn("+ / - · 0 · Ctrl+wheel", shown["keys"], shown)
|
||||||
|
|
||||||
def test_chromium_zooms_a_tile_by_keys_wheel_and_menu_and_keeps_it(self):
|
def test_chromium_zooms_a_tile_by_keys_wheel_and_menu_and_keeps_it(self):
|
||||||
data = self.drive(self.steps("chromium"), None, init=w4.GUARD)
|
data = self.drive(self.steps("chromium"), None, init=w4.GUARD)
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ class TestWorkbenchOperatorTasks(HubCase):
|
|||||||
self.assertEqual(feedback["kept"], {"review": ["src/app.py:2right-click note"], "ask": ["/repo:1key f note"]})
|
self.assertEqual(feedback["kept"], {"review": ["src/app.py:2right-click note"], "ask": ["/repo:1key f note"]})
|
||||||
self.assertFalse(feedback["wide"])
|
self.assertFalse(feedback["wide"])
|
||||||
radio = [" ".join(args) for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
radio = [" ".join(args) for script, args in self.scripts.calls if script == skill_scripts.RADIO]
|
||||||
granted = [entry for entry in radio if entry.startswith("send post --to Skills ") and "Granted: feat: w" in entry and "Notes:" in entry and "right-click note" in entry]
|
granted = [entry for entry in radio if entry.startswith("post --to Skills ") and "Granted: feat: w" in entry and "Notes:" in entry and "right-click note" in entry]
|
||||||
self.assertEqual(len(granted), len(base.WIDTHS) if signs else 0, radio)
|
self.assertEqual(len(granted), len(base.WIDTHS) if signs else 0, radio)
|
||||||
asks = {ask["command"]: (ask["status"], ask.get("channel", ""), ask.get("reason", "")) for ask in self.httpd.hub.asks.listed() if "keyed" in ask["command"]}
|
asks = {ask["command"]: (ask["status"], ask.get("channel", ""), ask.get("reason", "")) for ask in self.httpd.hub.asks.listed() if "keyed" in ask["command"]}
|
||||||
self.assertEqual(asks, {f"git commit -m 'w{width} keyed'": ("denied", "call", "/repo:1: key f note") if signs else ("pending", "", "") for width, _ in base.WIDTHS})
|
self.assertEqual(asks, {f"git commit -m 'w{width} keyed'": ("denied", "call", "/repo:1: key f note") if signs else ("pending", "", "") for width, _ in base.WIDTHS})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import unittest
|
|||||||
from hub_support import HUB
|
from hub_support import HUB
|
||||||
|
|
||||||
TEMPLATES = HUB / "templates"
|
TEMPLATES = HUB / "templates"
|
||||||
MODULES = ["page-constants.js", "answers.js", "page-reveal.js", "page-dom.js", "page-dialog.js", "page-inbox.js", "page-grant.js"]
|
MODULES = ["page-constants.js", "answers.js", "page-reveal.js", "page-dom.js", "page-dialog.js", "page-diff.js", "page-inbox.js", "page-grant.js"]
|
||||||
PROBE = r"""
|
PROBE = r"""
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const vm = require("vm");
|
const vm = require("vm");
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import unittest
|
|||||||
from hub_support import HUB
|
from hub_support import HUB
|
||||||
|
|
||||||
TEMPLATES = HUB / "templates"
|
TEMPLATES = HUB / "templates"
|
||||||
MODULES = ["page-constants.js", "page-reveal.js", "page-dom.js", "page-dialog.js", "page-api.js", "page-passkey.js", "page-inbox.js", "page-grant.js", "page-console.js", "page-rule-request.js", "page-load.js"]
|
MODULES = ["page-constants.js", "page-reveal.js", "page-dom.js", "page-dialog.js", "page-api.js", "page-passkey.js", "page-diff.js", "page-deny.js", "page-inbox.js", "page-grant.js", "page-console.js", "page-rule-request.js", "page-load.js"]
|
||||||
GONE = "operator/gui-agentbox-merge-push"
|
GONE = "operator/gui-agentbox-merge-push"
|
||||||
NOTICE = "already done or removed elsewhere"
|
NOTICE = "already done or removed elsewhere"
|
||||||
PROBE = r"""
|
PROBE = r"""
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ FIELDS = {
|
|||||||
"page-dialog.js": r'"aria-label": `Other answer to \$\{item\.id\}`[^}]*"data-skills": item\.repo \|\| ""',
|
"page-dialog.js": r'"aria-label": `Other answer to \$\{item\.id\}`[^}]*"data-skills": item\.repo \|\| ""',
|
||||||
"page-deny.js": r'placeholder: "e\.g\. make the gate green first", "data-skills": item\.repo \|\| ""',
|
"page-deny.js": r'placeholder: "e\.g\. make the gate green first", "data-skills": item\.repo \|\| ""',
|
||||||
"page-inbox.js": r'placeholder: "e\.g\. make the gate green first", "data-skills": ""',
|
"page-inbox.js": r'placeholder: "e\.g\. make the gate green first", "data-skills": ""',
|
||||||
"page-diff.js": r'"aria-label": "Feedback", title: "Feedback", "data-skills": ""',
|
"page-diff.js": r'"aria-label": "Comment", placeholder: "Comment on these lines", "data-skills": ""',
|
||||||
}
|
}
|
||||||
FEEDBACK = r'class: "field match-feedback", [^}]*"data-skills": card\.repo \|\| ""'
|
FEEDBACK = r'class: "field match-feedback", [^}]*"data-skills": card\.repo \|\| ""'
|
||||||
RANK = r"""
|
RANK = r"""
|
||||||
|
|||||||
Reference in new issue
Block a user