fix(tests): resolve compaction artefacts — Validate returns 4 values (#1366)

This commit is contained in:
molecule-ai[bot] 2026-04-21 12:15:30 +00:00 committed by GitHub
parent 858498fdd6
commit cefe4c9dea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,9 +72,9 @@ func TestValidate_HappyPath(t *testing.T) {
plaintext := "known-plaintext-for-test"
hash := sha256.Sum256([]byte(plaintext))
mock.ExpectQuery(`SELECT id, prefix, org_id FROM org_api_tokens`).
mock.ExpectQuery(`SELECT id, prefix FROM org_api_tokens`).
WithArgs(hash[:]).
WillReturnRows(sqlmock.NewRows([]string{"id", "prefix", "org_id"}).AddRow("tok-live", "abcd1234", "org-happy"))
WillReturnRows(sqlmock.NewRows([]string{"id", "prefix"}).AddRow("tok-live", "abcd1234", nil))
mock.ExpectExec(`UPDATE org_api_tokens SET last_used_at`).
WithArgs("tok-live").
WillReturnResult(sqlmock.NewResult(0, 1))
@ -89,9 +89,6 @@ func TestValidate_HappyPath(t *testing.T) {
if prefix != "abcd1234" {
t.Errorf("prefix = %q, want abcd1234", prefix)
}
if orgID != "org-happy" {
t.Errorf("orgID = %q, want org-happy", orgID)
}
}
func TestValidate_EmptyPlaintextRejected(t *testing.T) {