Scope knowledge and image libraries by brand
Frontend CI / Frontend (push) Successful in 2m59s
Backend CI / Backend (push) Successful in 14m58s

This commit is contained in:
2026-06-30 12:30:10 +08:00
parent 95ddb3057f
commit ced0c4ec0f
35 changed files with 1136 additions and 326 deletions
@@ -245,6 +245,7 @@ func TestPrepareEnterpriseSiteImageURLsEmbedsPublicAssetImages(t *testing.T) {
got := svc.prepareEnterpriseSiteImageURLs(
context.Background(),
7,
11,
`<p><img src="/api/public/assets/`+token+`" data-src="/api/public/assets/`+token+`" /></p>`,
"http://127.0.0.1:8080",
)
@@ -271,6 +272,7 @@ func TestPrepareEnterpriseSiteImageURLsEmbedsPublicAssetImagesWithStaleSignature
got := svc.prepareEnterpriseSiteImageURLs(
context.Background(),
7,
11,
`<p><img src="http://localhost:5178/api/public/assets/`+token+`" /></p>`,
"http://127.0.0.1:8080",
)
@@ -297,6 +299,7 @@ func TestPrepareEnterpriseSiteImageURLsStripsSaaSImageAttrs(t *testing.T) {
got := svc.prepareEnterpriseSiteImageURLs(
context.Background(),
7,
11,
`<p><img src="/api/public/assets/`+token+`" alt="" data-asset-id="35" asset-id="35" /></p>`,
"http://127.0.0.1:8080",
)
@@ -320,6 +323,7 @@ func TestPrepareEnterpriseSiteImageURLsDropsUnavailableSaaSAssetImage(t *testing
got := svc.prepareEnterpriseSiteImageURLs(
context.Background(),
7,
11,
`<p>前文</p><p class="article-editor-image article-editor-image--center" align="center"><img src="http://localhost:5178/api/public/assets/`+token+`" alt="" /></p><p>后文</p>`,
"http://127.0.0.1:8080",
)
@@ -346,6 +350,7 @@ func TestPrepareEnterpriseSiteImageURLsEmbedsIncompletePublicAssetPaths(t *testi
got := svc.prepareEnterpriseSiteImageURLs(
context.Background(),
7,
11,
`<p><img src="api/public/assets/`+token+`?format=png" /></p>`,
"http://127.0.0.1:8080",
)
@@ -373,7 +378,7 @@ func TestMarkdownRenderedEnterpriseSiteImageEmbedsIncompletePublicAssetPath(t *t
t.Fatalf("render markdown: %v", err)
}
got := svc.prepareEnterpriseSiteImageURLs(context.Background(), 7, html, "http://127.0.0.1:8080")
got := svc.prepareEnterpriseSiteImageURLs(context.Background(), 7, 11, html, "http://127.0.0.1:8080")
if storage.gotKey != objectKey {
t.Fatalf("object key = %q, want %q", storage.gotKey, objectKey)
@@ -398,6 +403,7 @@ func TestPrepareEnterpriseSitePublishAssetsEmbedsIncompleteCoverAssetPath(t *tes
got := svc.prepareEnterpriseSiteCoverURL(
context.Background(),
7,
11,
"api/public/assets/"+token+"?format=png",
nil,
"http://127.0.0.1:8080",
@@ -423,6 +429,7 @@ func TestPrepareEnterpriseSiteCoverURLDropsUnavailableSaaSAssetURL(t *testing.T)
got := svc.prepareEnterpriseSiteCoverURL(
context.Background(),
7,
11,
"http://localhost:5178/api/public/assets/"+token,
nil,
"http://127.0.0.1:8080",