oficina / mapa Public

Wrap the title gates to the code budget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev d3e77542ee133fdba24e3c1d3947e9c12d68d7e6 parent d6a615c
1 file changed, +10 −5
  • internal/mapatest/title_browser_test.go +10 −5
diff --git a/internal/mapatest/title_browser_test.go b/internal/mapatest/title_browser_test.go
index ae606f8..b4e24bb 100644
--- a/internal/mapatest/title_browser_test.go
+++ b/internal/mapatest/title_browser_test.go
@@ -25,7 +25,8 @@ import (
// The shared state's logic is editor/title.test.mjs.
// titleText is the H1's editable text, once the script has made it so.
-const titleText = `h1[mapa-title][mapa-rename] [mapa-title-text][contenteditable]`
+const titleText = `h1[mapa-title][mapa-rename] ` +
+ `[mapa-title-text][contenteditable]`
// headerTitle is the bar's title field.
const headerTitle = `form[estilo-bar-title] input[estilo-bar-title-input]`
@@ -143,7 +144,8 @@ func TestTitleEscRevertsAndWritesNothing(t *testing.T) {
now != versions {
t.Fatalf("Esc wrote: %q, %d versions", title, now)
}
- got := evaluate(t, rig, `[document.querySelector("h1[mapa-title]").textContent,
+ got := evaluate(t, rig, `[
+ document.querySelector("h1[mapa-title]").textContent,
document.activeElement === document.querySelector("[mapa-title-text]"),
document.querySelector("[mapa-title-note]").textContent].join("|")`)
if got != "Halden|false|" {
@@ -161,7 +163,8 @@ func TestTitleRefusalIsInlineAndKeepsTheText(t *testing.T) {
drive(t, rig, selectTitle(),
chromedp.KeyEvent("acme"), chromedp.KeyEvent("\r"),
chromedp.WaitVisible(`[mapa-title-note] [role="alert"]`))
- got := evaluate(t, rig, `[document.querySelector("h1[mapa-title]").textContent,
+ got := evaluate(t, rig, `[
+ document.querySelector("h1[mapa-title]").textContent,
document.querySelector("[mapa-title-note] [role=alert]").textContent,
document.querySelector("[mapa-title-text]").getAttribute("aria-invalid"),
document.querySelector("form[estilo-bar-title] input").value].join("|")`)
@@ -241,8 +244,10 @@ func TestTitleIsNotEditableOnDailyOrScratchPages(t *testing.T) {
chromedp.Navigate(rig.Origin+path), chromedp.WaitVisible(mounted))
want := map[bool]string{true: "1", false: "0"}[path ==
mapa.PagePath(team)]
- if got := evaluate(t, rig, `String(document.querySelectorAll(
- "h1[mapa-title] [contenteditable], h1[mapa-title][contenteditable]").length)`); got != want {
+ got := evaluate(t, rig, `String(document.querySelectorAll(
+ "h1[mapa-title] [contenteditable], h1[mapa-title][contenteditable]"
+).length)`)
+ if got != want {
t.Errorf("%s: %s editable titles, want %s", path, got, want)
}
}