test: fix type assertion in autocomplete test

- Change type assertion from []map[string]interface{} to []interface{}
- JSON unmarshal into interface{} creates []interface{}, not typed slices
- Fixes panic: interface conversion error in test

The response["results"] field needs to be asserted as []interface{}
when the parent is unmarshaled into map[string]interface{}.
This matches Go's JSON unmarshaling behavior for interface{} types.
This commit is contained in:
2026-03-25 21:01:21 -04:00
parent fcc8b38c52
commit 80d423663b
+1 -1
View File
@@ -114,7 +114,7 @@ func TestTagsFilter(t *testing.T) {
err := json.Unmarshal(rec.Body.Bytes(), &response)
require.NoError(t, err)
results := response["results"].([]map[string]interface{})
results := response["results"].([]interface{})
assert.Greater(t, len(results), 0, "Should return 'Science Fiction' in autocomplete results")
})