@@ -119,7 +119,6 @@ test.describe('badge API', () => {
119119 } )
120120
121121 test ( 'light color produces dark text for contrast' , async ( { page, baseURL } ) => {
122- // FFDC3B is a bright yellow — should get #000000 text
123122 const url = toLocalUrl ( baseURL , '/api/registry/badge/version/nuxt?color=FFDC3B' )
124123 const { body } = await fetchBadge ( page , url )
125124
@@ -128,7 +127,6 @@ test.describe('badge API', () => {
128127 } )
129128
130129 test ( 'dark color keeps white text for contrast' , async ( { page, baseURL } ) => {
131- // 0a0a0a is near-black — should keep #ffffff text
132130 const url = toLocalUrl ( baseURL , '/api/registry/badge/version/nuxt?color=0a0a0a' )
133131 const { body } = await fetchBadge ( page , url )
134132
@@ -137,7 +135,6 @@ test.describe('badge API', () => {
137135 } )
138136
139137 test ( 'light labelColor produces dark label text for contrast' , async ( { page, baseURL } ) => {
140- // ffffff label background — should get #000000 label text
141138 const url = toLocalUrl ( baseURL , '/api/registry/badge/version/nuxt?labelColor=ffffff' )
142139 const { body } = await fetchBadge ( page , url )
143140
@@ -146,7 +143,6 @@ test.describe('badge API', () => {
146143 } )
147144
148145 test ( '3-char hex color is handled correctly for contrast' , async ( { page, baseURL } ) => {
149- // CCC expands to CCCCCC — a light grey, should get dark text
150146 const url = toLocalUrl ( baseURL , '/api/registry/badge/version/nuxt?color=CCC' )
151147 const { body } = await fetchBadge ( page , url )
152148
@@ -161,7 +157,7 @@ test.describe('badge API', () => {
161157 const url = toLocalUrl ( baseURL , '/api/registry/badge/version/nuxt?style=shieldsio&color=FFDC3B' )
162158 const { body } = await fetchBadge ( page , url )
163159
164- expect ( body ) . toContain ( ' fill="#ffffff">version' )
160+ expect ( body ) . toMatch ( / f i l l = " # f f f f f f " ( \s t e x t L e n g t h = " \d + " ) ? > v e r s i o n / )
165161 expect ( body ) . toMatch ( / f i l l = " # 0 0 0 0 0 0 " > v \d / )
166162 } )
167163
0 commit comments