Skip to content

Commit be08424

Browse files
committed
up
1 parent 47e83b4 commit be08424

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

test/e2e/badge.spec.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff 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(/fill="#ffffff">v\d/)
145+
expect(body).toMatch(/fill="#000000">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(/fill="#000000">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(/fill="#000000">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}`)

0 commit comments

Comments
 (0)