Files
selfpost/internal/web/view/paneljs_test.go
T
mixandClaude Opus 5.5 6edf8314bc user form, backup: two gaps the mockup comparison found
Owner, 2026-10-18: "Что ещё из макетов мы также прошляпили?" - every mockup
held against the panel; two small gaps beyond the queues:

- user.html: with All ticked, a list's single domains are disabled
  (mockup user.html:34-36). A panel.js show-when rule with disable: the
  boxes data-single-out / data-single-in follow data-all-out / data-all-in,
  at load and on change; a disabled box is not submitted, which the server
  ignores with All anyway. node test testdata/alldomains_test.js (fails on
  the previous panel.js).
- backup.html: "domain's settings" is a link, to Outbound › Domains (mockup
  backup.html:35 links a domain's settings; a server page has no one domain).

Tests: go test ./internal/web/... pass, TestPanelJS with node 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 23:30:44 +03:00

29 lines
924 B
Go

package view
import (
"os/exec"
"path/filepath"
"testing"
)
// panel.js run in node against a stand-in for the parts of the DOM and htmx
// it uses (testdata/*_test.js): the refreshes of the monitoring boxes
// survive a failure and back off (audit 2026-10-12, M11), and a button that
// leaves the page asks first when a field holds an unsaved edit (L19).
// Skipped where node is not installed - the test server's Go has none; the
// workstation runs it.
func TestPanelJS(t *testing.T) {
node, err := exec.LookPath("node")
if err != nil {
t.Skip("node is not installed")
}
for _, script := range []string{"poll_test.js", "unsaved_test.js", "filename_test.js", "alldomains_test.js"} {
t.Run(script, func(t *testing.T) {
out, err := exec.Command(node, filepath.Join("testdata", script), filepath.Join("static", "panel.js")).CombinedOutput()
if err != nil {
t.Fatalf("%v\n%s", err, out)
}
})
}
}