kopia lustrzana https://github.com/badgen/badgen
test: update tests
rodzic
e86ac0d3de
commit
39cb1778ef
|
@ -19,8 +19,8 @@ exports[`test/index.spec.js TAP generate badge with { subject, status } > snapsh
|
|||
<rect width="80.4" height="20" fill="url(#a)"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="6" y="14.8" fill="#000" opacity="0.25">npm</text>
|
||||
<text x="5" y="13.8">npm</text>
|
||||
<text x="6" y="14.8" textLength="24.9" fill="#000" opacity="0.25">npm</text>
|
||||
<text x="5" y="13.8" textLength="24.9">npm</text>
|
||||
<text x="40.4" y="14.8" fill="#000" opacity="0.25" textLength="35.5">v1.0.0</text>
|
||||
<text x="39.4" y="13.8" textLength="35.5">v1.0.0</text>
|
||||
</g>
|
||||
|
@ -43,8 +43,8 @@ exports[`test/index.spec.js TAP generate badge with { subject, status, color } >
|
|||
<rect width="80.4" height="20" fill="url(#a)"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="6" y="14.8" fill="#000" opacity="0.25">npm</text>
|
||||
<text x="5" y="13.8">npm</text>
|
||||
<text x="6" y="14.8" textLength="24.9" fill="#000" opacity="0.25">npm</text>
|
||||
<text x="5" y="13.8" textLength="24.9">npm</text>
|
||||
<text x="40.4" y="14.8" fill="#000" opacity="0.25" textLength="35.5">v1.0.0</text>
|
||||
<text x="39.4" y="13.8" textLength="35.5">v1.0.0</text>
|
||||
</g>
|
||||
|
@ -61,8 +61,8 @@ exports[`test/index.spec.js TAP generate badge with { subject, status, style } >
|
|||
<rect x="34.9" width="45.5" height="20" fill="#08C"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="6" y="14.8" fill="#000" opacity="0.1">npm</text>
|
||||
<text x="5" y="13.8">npm</text>
|
||||
<text x="6" y="14.8" textLength="24.9" fill="#000" opacity="0.1">npm</text>
|
||||
<text x="5" y="13.8" textLength="24.9">npm</text>
|
||||
<text x="40.4" y="14.8" fill="#000" opacity="0.1" textLength="35.5">v1.0.0</text>
|
||||
<text x="39.4" y="13.8" textLength="35.5">v1.0.0</text>
|
||||
</g>
|
||||
|
@ -79,8 +79,8 @@ exports[`test/index.spec.js TAP generate badge with { subject, status, color, st
|
|||
<rect x="34.9" width="45.5" height="20" fill="#ADF"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="6" y="14.8" fill="#000" opacity="0.1">npm</text>
|
||||
<text x="5" y="13.8">npm</text>
|
||||
<text x="6" y="14.8" textLength="24.9" fill="#000" opacity="0.1">npm</text>
|
||||
<text x="5" y="13.8" textLength="24.9">npm</text>
|
||||
<text x="40.4" y="14.8" fill="#000" opacity="0.1" textLength="35.5">v1.0.0</text>
|
||||
<text x="39.4" y="13.8" textLength="35.5">v1.0.0</text>
|
||||
</g>
|
||||
|
@ -103,8 +103,8 @@ exports[`test/index.spec.js TAP generate badge with { subject, status, icon } >
|
|||
<rect width="96.5" height="20" fill="url(#a)"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="22.5" y="14.8" fill="#000" opacity="0.25">docker</text>
|
||||
<text x="21.5" y="13.8">docker</text>
|
||||
<text x="22.5" y="14.8" textLength="37.1" fill="#000" opacity="0.25">docker</text>
|
||||
<text x="21.5" y="13.8" textLength="37.1">docker</text>
|
||||
<text x="69.6" y="14.8" fill="#000" opacity="0.25" textLength="22.4">icon</text>
|
||||
<text x="68.6" y="13.8" textLength="22.4">icon</text>
|
||||
</g>
|
||||
|
@ -113,6 +113,30 @@ exports[`test/index.spec.js TAP generate badge with { subject, status, icon } >
|
|||
|
||||
`
|
||||
|
||||
exports[`test/index.spec.js TAP generate badge with { status, icon } > snapshot 1`] = `
|
||||
|
||||
<svg width="53.4" height="20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<linearGradient id="a" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#EEE" stop-opacity=".1"/>
|
||||
<stop offset="1" stop-opacity=".1"/>
|
||||
</linearGradient>
|
||||
<mask id="m"><rect width="53.4" height="20" rx="3" fill="#FFF"/></mask>
|
||||
<g mask="url(#m)">
|
||||
<rect width="21" height="20" fill="#555"/>
|
||||
<rect x="21" width="32.4" height="20" fill="#08C"/>
|
||||
<rect width="53.4" height="20" fill="url(#a)"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="22.5" y="14.8" textLength="0" fill="#000" opacity="0.25"></text>
|
||||
<text x="21.5" y="13.8" textLength="0"></text>
|
||||
<text x="26.5" y="14.8" fill="#000" opacity="0.25" textLength="22.4">icon</text>
|
||||
<text x="25.5" y="13.8" textLength="22.4">icon</text>
|
||||
</g>
|
||||
<image x="3.9" y="3.5" width="13" height="13" xlink:href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTg5IiB3aWR0aD0iMjIxLjY2NyI+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBkPSJNMCAxNDEuNzVoMTY2LjI1VjBIMHoiLz48L2NsaXBQYXRoPjxjbGlwUGF0aCBpZD0iYiI+PHBhdGggZD0iTTAgMTQxLjc1aDE2Ni4yNVYwSDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIiB0cmFuc2Zvcm09Im1hdHJpeCgxLjMzMzMzIDAgMCAtMS4zMzMzMyAwIDE4OSkiPjxwYXRoIGQ9Ik05NC4yNjggNzYuMjA0aDE1Ljc0M3YxNC4zMTJIOTQuMjY4em0tMTguN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PSJNMTA0LjEzNyAyNC4yNDFoLjIxNmMuMjUyIDAgLjQ1Ni4wODQuNDU2LjI4OCAwIC4xOC0uMTMyLjMtLjQyLjMtLjEyIDAtLjIwNC0uMDEyLS4yNTItLjAyNHptLS4wMTItMS4xMTVoLS40NTZ2MS45NjdjLjE4LjAzNi40MzIuMDYuNzU2LjA2LjM3MiAwIC41MzktLjA2LjY4NC0uMTQ0YS41NDcuNTQ3IDAgMCAwIC4xOS0uNDMyYzAtLjIxNi0uMTY3LS4zODQtLjQwNi0uNDU1di0uMDI1Yy4xOS0uMDcyLjMtLjIxNS4zNTktLjQ3OS4wNi0uMy4wOTYtLjQyLjE0NS0uNDkyaC0uNDkyYy0uMDYuMDcyLS4wOTYuMjUyLS4xNTcuNDgtLjAzNS4yMTYtLjE1NS4zMTItLjQwNy4zMTJoLS4yMTZ6bS0xLjIxMiAxLjAzMmMwLS44NzYuNjQ5LTEuNTcgMS41MzYtMS41Ny44NjQgMCAxLjQ5OS42OTQgMS40OTkgMS41NTcgMCAuODc2LS42MzUgMS41ODMtMS41MTEgMS41ODMtLjg3NSAwLTEuNTI0LS43MDctMS41MjQtMS41N20zLjUzOCAwYzAtMS4xMTYtLjg3NS0xLjk5LTIuMDE0LTEuOTktMS4xMjcgMC0yLjAyNy44NzQtMi4wMjcgMS45OSAwIDEuMDkxLjkgMS45NjcgMi4wMjcgMS45NjcgMS4xMzkgMCAyLjAxNC0uODc2IDIuMDE0LTEuOTY3IiBmaWxsPSIjZmZmZmZmIi8+PC9nPjwvc3ZnPgo="/>
|
||||
</svg>
|
||||
|
||||
`
|
||||
|
||||
exports[`test/index.spec.js TAP generate badge with { subject, status, icon, style } > snapshot 1`] = `
|
||||
|
||||
<svg width="96.5" height="20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
@ -121,8 +145,8 @@ exports[`test/index.spec.js TAP generate badge with { subject, status, icon, sty
|
|||
<rect x="64.1" width="32.4" height="20" fill="#08C"/>
|
||||
</g>
|
||||
<g fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text x="22.5" y="14.8" fill="#000" opacity="0.1">docker</text>
|
||||
<text x="21.5" y="13.8">docker</text>
|
||||
<text x="22.5" y="14.8" textLength="37.1" fill="#000" opacity="0.1">docker</text>
|
||||
<text x="21.5" y="13.8" textLength="37.1">docker</text>
|
||||
<text x="69.6" y="14.8" fill="#000" opacity="0.1" textLength="22.4">icon</text>
|
||||
<text x="68.6" y="13.8" textLength="22.4">icon</text>
|
||||
</g>
|
||||
|
|
|
@ -36,6 +36,13 @@ tap.test('generate badge with { subject, status, icon }', t => {
|
|||
t.end()
|
||||
})
|
||||
|
||||
tap.test('generate badge with { status, icon }', t => {
|
||||
const icon = require('./docker-icon-b64.js')
|
||||
const svg = badgen({ subject: '', status: 'icon', icon })
|
||||
t.matchSnapshot(svg, 'snapshot')
|
||||
t.end()
|
||||
})
|
||||
|
||||
tap.test('generate badge with { subject, status, icon, style }', t => {
|
||||
const icon = require('./docker-icon-b64.js')
|
||||
const svg = badgen({ subject: 'docker', status: 'icon', style: 'flat', icon })
|
||||
|
|
Ładowanie…
Reference in New Issue