1package e2e23import (4 "strings"5 "testing"6)78// TestLongErrorOnF1 checks that at 60 columns an error's explanation9// too long for the context line ends in … with an F1 chip, that F110// shows all of it in a box, and that a key closes the box.11func TestLongErrorOnF1(t *testing.T) {12 t.Parallel()13 s := startWith(t, options{cols: 60, rows: 16})14 s.keys("='Quarterly results by region 26'!A1+1", "<enter>", "<up>")15 s.waitFor("#REF!")16 s.eventually("the explanation cut, with F1", func() bool {17 l := s.line(2)18 return strings.Contains(l, "Unresolved sheet") && strings.Contains(l, "…") && strings.Contains(l, "F1")19 })20 s.keys("<f1>")21 s.waitFor("#REF! in A1")22 s.waitFor("'Quarterly results by")23 s.keys("<esc>")24 s.eventually("the box closed", func() bool { return !strings.Contains(s.screen(), "#REF! in A1") })25 if !strings.Contains(s.line(0), "READY") {26 t.Errorf("mode after the box: %q", s.line(0))27 }28}