File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ test.describe('badge API', () => {
142142 const { body } = await fetchBadge ( page , url )
143143
144144 expect ( body ) . toContain ( 'fill="#000000">version' )
145- expect ( body ) . toMatch ( / f i l l = " # f f f f f f " > v \d / )
145+ expect ( body ) . toMatch ( / f i l l = " # 0 0 0 0 0 0 " > v \d / )
146146 } )
147147
148148 test ( '3-char hex color is handled correctly for contrast' , async ( { page, baseURL } ) => {
@@ -154,6 +154,17 @@ test.describe('badge API', () => {
154154 expect ( body ) . toMatch ( / f i l l = " # 0 0 0 0 0 0 " > v \d / )
155155 } )
156156
157+ test ( 'light colour produces dark text for contrast in shieldsio style' , async ( {
158+ page,
159+ baseURL,
160+ } ) => {
161+ const url = toLocalUrl ( baseURL , '/api/registry/badge/version/nuxt?style=shieldsio&color=FFDC3B' )
162+ const { body } = await fetchBadge ( page , url )
163+
164+ expect ( body ) . toContain ( 'fill="#ffffff">version' )
165+ expect ( body ) . toMatch ( / f i l l = " # 0 0 0 0 0 0 " > v \d / )
166+ } )
167+
157168 test ( 'custom label parameter is applied to SVG' , async ( { page, baseURL } ) => {
158169 const customLabel = 'my-label'
159170 const url = toLocalUrl ( baseURL , `/api/registry/badge/version/nuxt?label=${ customLabel } ` )
You can’t perform that action at this time.
0 commit comments