mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-09 18:06:45 +08:00
* feat: add semantic issue activity timestamps Co-authored-by: multica-agent <[email protected]> * fix(migrations): register issue activity index cleanup Co-authored-by: multica-agent <[email protected]> * fix(issues): address last activity review Co-authored-by: multica-agent <[email protected]> * fix(issues): close last activity review gaps Co-authored-by: multica-agent <[email protected]> * fix(issues): harden activity rollout safeguards Co-authored-by: multica-agent <[email protected]> --------- Co-authored-by: Sol-Boy <[email protected]> Co-authored-by: multica-agent <[email protected]>
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package db
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
func TestCreateCommentRowCommentPreservesCanonicalFields(t *testing.T) {
|
|
viaPluginID := pgtype.UUID{Bytes: [16]byte{1}, Valid: true}
|
|
row := CreateCommentRow{
|
|
Content: "created comment",
|
|
Revision: 7,
|
|
ViaPluginID: viaPluginID,
|
|
IssueRevision: 11,
|
|
}
|
|
|
|
comment := row.Comment()
|
|
if comment.Content != row.Content {
|
|
t.Fatalf("content = %q, want %q", comment.Content, row.Content)
|
|
}
|
|
if comment.Revision != row.Revision {
|
|
t.Fatalf("revision = %d, want %d", comment.Revision, row.Revision)
|
|
}
|
|
if comment.ViaPluginID != viaPluginID {
|
|
t.Fatalf("via_plugin_id = %#v, want %#v", comment.ViaPluginID, viaPluginID)
|
|
}
|
|
}
|
|
|
|
func TestUpdateCommentRowCommentPreservesCanonicalFields(t *testing.T) {
|
|
viaPluginID := pgtype.UUID{Bytes: [16]byte{2}, Valid: true}
|
|
row := UpdateCommentRow{
|
|
Content: "updated comment",
|
|
Revision: 8,
|
|
ViaPluginID: viaPluginID,
|
|
IssueRevision: 12,
|
|
}
|
|
|
|
comment := row.Comment()
|
|
if comment.Content != row.Content || comment.Revision != row.Revision {
|
|
t.Fatalf("comment = (%q, %d), want (%q, %d)", comment.Content, comment.Revision, row.Content, row.Revision)
|
|
}
|
|
if comment.ViaPluginID != viaPluginID {
|
|
t.Fatalf("via_plugin_id = %#v, want %#v", comment.ViaPluginID, viaPluginID)
|
|
}
|
|
}
|