Files
team-go/pkg/account/workspaceinfo_test.go
zeekay c6dc8ac2f7 Hanzo Team
The Go transactor and account service for Hanzo Team.

History starts here. The previous 107 commits carried the fork's origin in
their messages and their tree, and none of it described this code: the Go
under pkg/transactor is Hanzo's own work implementing a wire protocol, not
a port of anyone's implementation.

pkg/transactor/model.json remains, and remains attributed. It is a compiled
platform model this transactor loads through go:embed, governed by EPL-2.0
and named in NOTICE. Removing it is a replacement project -- a new compiler
and a move off the protocol -- not a deletion.
2026-08-30 17:07:38 -07:00

35 lines
1.1 KiB
Go

package account
import (
"fmt"
"testing"
"github.com/hanzoai/base/core"
"github.com/hanzoai/team/pkg/model"
)
// TestWorkspaceInfoVersionTracksModel is the no-drift guard on the account
// side: getUserWorkspaces' versionMajor/Minor/Patch is the MODEL version
// (the SAME source the transactor reports as serverVersion) — not the old
// hardcoded 0.7.0. Default is the front's 0.6.0.
func TestWorkspaceInfoVersionTracksModel(t *testing.T) {
ws := core.NewRecord(core.NewBaseCollection("workspaces"))
info := toWorkspaceInfo(ws)
if info.VersionMajor != model.Major() ||
info.VersionMinor != model.Minor() ||
info.VersionPatch != model.Patch() {
t.Fatalf("workspace version = %d.%d.%d, want model %d.%d.%d",
info.VersionMajor, info.VersionMinor, info.VersionPatch,
model.Major(), model.Minor(), model.Patch())
}
got := fmt.Sprintf("%d.%d.%d", info.VersionMajor, info.VersionMinor, info.VersionPatch)
if got != model.Version() {
t.Fatalf("workspace version %q != model.Version() %q", got, model.Version())
}
if got != "0.6.0" {
t.Fatalf("workspace version = %q, want default 0.6.0", got)
}
}