cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

cat/module-path
012 / e2e / screentrace_test.go
screentrace_test.go 1.9K
1package e2e23// Golden screens for formula tracing: precedents and dependents shown as4// the pointer moves, the list to go to one, and Evaluate formula, on dark5// and light terminals and in the high-contrast theme.67// traced is the named-range budget with the total read by a quarter8// beside it and a yearly figure far below, tracing on at the total.9func traced(s *session) {10 named(s)11 s.keys("<ctrl+g>", "B30", "<enter>", "=B7*12", "<enter>")12 s.keys("<ctrl+g>", "C7", "<enter>", "=B7/4", "<enter>")13 s.keys("<ctrl+home>", "<down>", "<down>", "<down>", "<down>", "<down>", "<down>", "<right>", "<alt+;>")14 s.waitFor("B7 reads Expenses; read by C7, B30↓")15}1617// evaluating is Evaluate formula on B8 with two parts computed.18func evaluating(s *session) {19 named(s)20 s.keys("<alt+=>", "<enter>", "<enter>")21 s.waitFor("2 of 3")22}2324func init() {25 screens = append(screens,26 screen{name: "trace-view", setup: traced},27 screen{name: "trace-view-light", opts: options{light: true}, setup: traced},28 screen{name: "trace-view-high-contrast", opts: options{config: highContrastConfig}, setup: traced},29 screen{name: "trace-view-high-contrast-light", opts: options{light: true, config: highContrastConfig}, setup: traced},30 screen{name: "trace-list", setup: func(s *session) {31 traced(s)32 s.keys("<alt+'>")33 s.waitFor("Precedents and dependents of B7")34 }},35 screen{name: "evaluate", setup: evaluating},36 screen{name: "evaluate-light", opts: options{light: true}, setup: evaluating},37 screen{name: "evaluate-high-contrast", opts: options{config: highContrastConfig}, setup: evaluating},38 screen{name: "evaluate-into", setup: func(s *session) {39 traced(s)40 s.keys("<right>", "<alt+=>", "<right>")41 s.waitFor("Evaluate C7 › B7")42 }},43 screen{name: "evaluate-narrow", opts: options{cols: 60, rows: 16}, setup: func(s *session) {44 named(s)45 s.keys("<alt+=>", "<enter>")46 s.waitFor("1 of 3")47 }},48 )49}