Fix numeric colorB (#2780)

Numeric colors weren't properly being handled by `makeBadge` after #2742.

Since this function really does not need to be accepting colors as strings, rather than make the function more lenient to work with Scoutcamp, I coerced the types of the colors on the way in.

Two tests cover the functionality in the modern service. I don't feel strongly that the legacy version needs coverage at this point, though I've added one for the moment on the github languages badge where this manifested.

Fix #2778
This commit is contained in:
Paul Melnikow
2019-01-16 11:55:50 -05:00
committed by GitHub
parent 8a10279d95
commit 4bf55a7826
5 changed files with 34 additions and 4 deletions

View File

@@ -106,8 +106,9 @@ function makeBadgeData(defaultLabel, overrides) {
logoPosition: +overrides.logoPosition,
logoWidth: +overrides.logoWidth,
links: toArray(overrides.link),
colorA: overrides.colorA,
colorB: overrides.colorB,
// Scoutcamp sometimes turns these into numbers.
colorA: `${overrides.colorA}`,
colorB: `${overrides.colorB}`,
}
}