oficina / meet Public

Clone
git clone https://amadan.net/oficina/meet

Plain git — no account needed to clone.

Download

Download this file

1package callstest
2
3import (
4 "amadan.net/oficina/estilo.git/busy"
5 "bytes"
6 "os"
7 "path/filepath"
8 "testing"
9
10 "amadan.net/oficina/estilo.git/theme"
11 "amadan.net/rastrillo/rastrillo/ui"
12)
13
14// The scaffold delivered these files once; they are app-owned from
15// then on. This test pins each vendored copy byte-identical to the
16// library it came from: a reviewer runs the suite instead of reading
17// ~56KB of assets as app diff, and a framework upgrade that forgets
18// to re-copy is caught instead of drifting silently. If you edit one
19// DELIBERATELY, delete its line below — the file is yours.
20func TestVendoredAssetsMatchTheLibrary(t *testing.T) {
21 // theme.css is no longer day's: it is Calma with Calls' accent, from
22 // estilo (estilo AGENTS.md, decisions table, row 8), pinned below.
23 for name, lib := range map[string][]byte{
24 "tokens.css": ui.TokensCSS(),
25 "select.js": ui.SelectJS(),
26 } {
27 vendored, err := os.ReadFile(filepath.Join("..", "calls", "static", name))
28 if err != nil {
29 t.Errorf("read vendored %s: %v", name, err)
30 continue
31 }
32 if !bytes.Equal(vendored, lib) {
33 t.Errorf("static/%s differs from the library copy; re-copy it (or delete its pin if the edit was deliberate)", name)
34 }
35 }
36}
37
38// static/theme.css pinned to the estilo this app is built against. After
39// an estilo upgrade, re-write it with `go run ./scripts/writeestilo`.
40func TestThemeIsEstilosForCalls(t *testing.T) {
41 want, ok := theme.ForApp("calls")
42 if !ok {
43 t.Fatal("estilo's theme ring has no calls")
44 }
45 got, err := os.ReadFile(filepath.Join("..", "calls", "static", "theme.css"))
46 if err != nil {
47 t.Fatal(err)
48 }
49 if !bytes.Equal(got, want) {
50 t.Error("static/theme.css differs from estilo's theme for calls; run go run ./scripts/writeestilo")
51 }
52}
53
54// rastrillo's busy rule (Paul, 2026-09-29): a submit button's label gives
55// way to a spinner for at least 650ms, the button disables, and Back
56// resets it. static/ carries it as estilo does — the shim without the old
57// rule, busy.js and busy.css — pinned here to the estilo this app builds
58// against. After an estilo upgrade: go run ./scripts/writeestilo.
59func TestBusyFilesAreEstilos(t *testing.T) {
60 for name, want := range map[string][]byte{
61 "rastrillo.js": busy.ShimJS(),
62 "busy.js": busy.JS(),
63 "busy.css": busy.CSS(),
64 } {
65 got, err := os.ReadFile(filepath.Join("..", "calls", "static", name))
66 if err != nil {
67 t.Fatal(err)
68 }
69 if !bytes.Equal(got, want) {
70 t.Errorf("static/%s differs from estilo's; run go run ./scripts/writeestilo", name)
71 }
72 }
73}
74