@@ -94,6 +94,41 @@ func TestQueryProfile_Success(t *testing.T) {
9494 if profile .Quality < 4.5 {
9595 t .Errorf ("quality = %f, want >= 4.5 (0.95 * 5)" , profile .Quality )
9696 }
97+ // Empty stamp rows → AssessmentCount should be 0
98+ if profile .AssessmentCount != 0 {
99+ t .Errorf ("AssessmentCount = %d, want 0 (no stamp rows)" , profile .AssessmentCount )
100+ }
101+ }
102+
103+ func TestQueryProfile_WithStamps (t * testing.T ) {
104+ sheetJSON , _ := json .Marshal (map [string ]any {
105+ "identity" : map [string ]any {"display_name" : "Test" },
106+ "value_dimensions" : map [string ]any {"quality" : 0.5 },
107+ })
108+
109+ q := & fakeQuerier {rows : map [string ][]map [string ]any {
110+ "SELECT handle" : {
111+ {
112+ "handle" : "test" ,
113+ "source" : "github" ,
114+ "sheet_json" : string (sheetJSON ),
115+ "confidence" : "0.8" ,
116+ "created_at" : "2024-01-01" ,
117+ },
118+ },
119+ "SELECT skill_tags" : {
120+ {"skill_tags" : `["go"]` , "valence" : `{"quality":4,"reliability":3,"creativity":2}` , "confidence" : "0.9" , "message" : "Strong Go skills" },
121+ {"skill_tags" : `["python"]` , "valence" : `{"quality":3,"reliability":4,"creativity":3}` , "confidence" : "0.8" , "message" : "Python experience" },
122+ },
123+ }}
124+
125+ profile , err := QueryProfile (q , "test" )
126+ if err != nil {
127+ t .Fatalf ("unexpected error: %v" , err )
128+ }
129+ if profile .AssessmentCount != 2 {
130+ t .Errorf ("AssessmentCount = %d, want 2" , profile .AssessmentCount )
131+ }
97132}
98133
99134func TestSearchProfiles (t * testing.T ) {
0 commit comments