mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-08 09:26:50 +08:00
* perf(server): avoid per-row issue status resolution Co-authored-by: multica-agent <[email protected]> * fix(server): address issue status query review nits Co-authored-by: multica-agent <[email protected]> --------- Co-authored-by: Sol-Boy <[email protected]> Co-authored-by: multica-agent <[email protected]>
27 lines
712 B
Go
27 lines
712 B
Go
package handler
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"slices"
|
|
"testing"
|
|
|
|
"github.com/multica-ai/multica/server/internal/issuestatus"
|
|
db "github.com/multica-ai/multica/server/pkg/db/generated"
|
|
)
|
|
|
|
func TestProjectTerminalIssueStatusKeysFallsBackToCanonicalKeys(t *testing.T) {
|
|
h := *testHandler
|
|
h.Queries = db.New(failQueryDBTX{
|
|
DBTX: testPool,
|
|
failOn: "SELECT key FROM issue_status",
|
|
err: errors.New("status catalog unavailable"),
|
|
})
|
|
|
|
got := h.projectTerminalIssueStatusKeys(context.Background(), parseUUID(testWorkspaceID))
|
|
want := []string{issuestatus.Done, issuestatus.Cancelled}
|
|
if !slices.Equal(got, want) {
|
|
t.Fatalf("project terminal keys = %v, want canonical fallback %v", got, want)
|
|
}
|
|
}
|