package controller import ( "github.com/stretchr/testify/assert" "github.com/tidwall/gjson" "testing" ) func TestManxueArtworkURL(t *testing.T) { assert.Empty(t, manxueArtworkURL(gjson.Parse(`{"public":false,"result":{"id":"private"}}`))) assert.Equal(t, "https://manxue.ai/?result=community-one", manxueArtworkURL(gjson.Parse(`{"public":true,"result":{"id":"community-one"}}`))) assert.Empty(t, manxueArtworkURL(gjson.Parse(`{"share_url":"https://evil.test/?result=one"}`))) } func TestArtworkPreservesScriptDrawnLegs(t *testing.T) { result := sanitizeDetectionHTML(``) assert.Contains(t, result, "