1package ui23import (4 "context"5 "strings"6 "testing"78 "src.rest/cat/012/internal/room"9)1011// Others read without color: their pointer's cell double-underlined,12// their initial on its row's header, their name on the status line,13// and a cell they just changed marked with ▘.14func TestMonochromePeers(t *testing.T) {15 r := newRooms(t, room.Edit)16 ann := r.open("ann", "@mono")17 bob := r.open("bob", "@mono")18 bob.press("<down>", "x", "<enter>", "<right>")19 r.sync()20 ann.sh.turn(func() {21 m := ann.m22 m.frameShare()23 c := cellAt(m, addr("B3"))24 if !every(c, true, func(c monoCell) bool { return c.underline == "2" }) {25 t.Errorf("bob's cell: %+v", c)26 }27 if row := cellText(monoLine(m, gridTop+2)); !strings.HasPrefix(row, "b") {28 t.Errorf("row 3's header %q", row)29 }30 if row := cellText(monoLine(m, gridTop+1)); !strings.Contains(row, "▘x") {31 t.Errorf("row 2 %q", row)32 }33 if !strings.Contains(cellText(monoLine(m, m.height-1)), " bob ") {34 t.Error("bob isn't on the status line")35 }36 })37}3839// Agents read without color too: their ◆ on the row header and before40// their name, and a ◇ on each cell a suggestion of theirs would set.41func TestMonochromeAgents(t *testing.T) {42 ls := startLive(t)43 ls.suggest("", "A1", "48")44 ls.agent.Focus(context.Background(), "B2")45 ls.sync()46 ls.sh.turn(func() {47 m := ls.m48 m.frameShare()49 if row := cellText(monoLine(m, gridTop)); !strings.Contains(row, "◇") {50 t.Errorf("row 1 %q", row)51 }52 if row := cellText(monoLine(m, gridTop+1)); !strings.HasPrefix(row, "◆") {53 t.Errorf("row 2's header %q", row)54 }55 if status := cellText(monoLine(m, m.height-1)); !strings.Contains(status, "◆ claude") || !strings.Contains(status, "◇ 1 suggestion") {56 t.Errorf("status line %q", status)57 }58 })59}