diff --git a/nuxt.config.ts b/nuxt.config.ts index 4ca8c85444..9a375d02b4 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -104,7 +104,7 @@ export default defineNuxtConfig({ isr: { expiration: 60 * 60 /* one hour */, passQuery: true, - allowQuery: ['color', 'labelColor', 'label', 'name', 'style'], + allowQuery: ['color', 'labelColor', 'label', 'name', 'style', 'value'], }, }, '/api/registry/image-proxy': { diff --git a/test/e2e/badge.spec.ts b/test/e2e/badge.spec.ts index c1272f58cb..820b77d4c7 100644 --- a/test/e2e/badge.spec.ts +++ b/test/e2e/badge.spec.ts @@ -172,6 +172,17 @@ test.describe('badge API', () => { expect(body).toContain(customLabel) }) + test('custom value parameter is applied to SVG', async ({ page, baseURL }) => { + const customValue = 'custom-value-123' + const url = toLocalUrl( + baseURL, + `/api/registry/badge/version/nuxt?value=${encodeURIComponent(customValue)}`, + ) + const { body } = await fetchBadge(page, url) + + expect(body).toContain(customValue) + }) + test('style=default keeps current badge renderer', async ({ page, baseURL }) => { const url = toLocalUrl(baseURL, '/api/registry/badge/version/nuxt?style=default') const { body } = await fetchBadge(page, url)