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:
@@ -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}`,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user