mavweb: extend test coverage to credentials, signal, dash, history, revert handlers

- New credentials_test.go: 4 test functions covering credentialStore
  (new, save, lookup, update, persistence across restarts).
- Extended handlers_test.go: fakeCore now supports WriteFact, Presence,
  RecentFacts/Nudges/Notes, RevertFact. Added 7 new test functions:
  TestNoCache, TestHandleSignal (5 subtestcases covering method guard,
  nil core, unknown key, known key, write error), TestHandleDash (3),
  TestHandleHistory (3), TestHandleRevert (6), and ListToolsError 502.
- Fixed history.html: Go html/template requires conditional class
  rendered as separate <tr> branches, not inline attribute.
This commit is contained in:
kami
2026-07-05 02:31:05 +04:00
parent 6daa96b66e
commit 185f4f578e
3 changed files with 541 additions and 1 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
<div id=msg></div>
<table>
<tr><th>when<th>kind<th>key<th>value<th>source<th>conf<th></tr>
{{range .Facts}}<tr{{if .VoidsID}} class=voided{{end}}>
{{range .Facts}}{{if .VoidsID}}<tr class=voided>{{else}}<tr>{{end}}
<td>{{if .VoidsID}}<span class=void-badge> voided</span>{{end}}{{.Ts.Format "2006-01-02 15:04"}}</td>
<td>{{.Kind}}</td>
<td class=key>{{.Key}}</td>