Commit Graph

9 Commits

Author SHA1 Message Date
Danial
a89b6bb163 remove whitespace from data URIs (#1546)
* remove newlines from datauri

* update test, remove decode

* support multiline datauris

* replace whitespace before checking isDataUri

removed multiline support from regex

* prependPrefix set default as empty string

* update
2018-03-08 03:09:29 +01:00
Danial
5ded37b5ff logo data uri encoding (#1527)
* logo datauri encode

no longer need to replace `+` with `%2B`

* add comment & tests for spaces
2018-02-27 21:57:06 +01:00
Paul Melnikow
7c1a3fef69 Adopt Chai for assertions (#1419) 2018-01-08 14:18:07 -07:00
Pyves
32671dfd87 Removal of hasPrefix function in badge-data.js (#1376)
* Removed hasPrefix method and added tests to cover prependPrefix
2017-12-18 17:58:28 +13:00
Paul Melnikow
7c1b1fc621 Fix style picker in markup modal (#1331)
- Restore correct list of styles to markup modal
- DRY lists of styles

Fix #1330
2017-12-05 18:08:13 -05:00
Marcin Mielnicki
0570a9e920 License badge colour corresponding to license type (#1190) 2017-12-05 16:43:29 -05:00
Paul Melnikow
7ca2e97155 Use sazerac for our data-driven tests (#1228)
Sazerac is a library for data-driven tests, where a series of tests asserts that the return value of a function matches the expected value. It provides nice syntax for tightening this up.

https://hackernoon.com/sazerac-data-driven-testing-for-javascript-e3408ac29d8c

This converts our tests to use it, and replaces some similar home-grown code.

I fixed one bug I encountered along the way: mikec/sazerac#12.
2017-11-01 20:15:19 -04:00
Paul Melnikow
f271b82670 Nudge forward style checks a la eslint-config-standard (#1082)
Because I despise nitpicking stuff like indentation and spacing in pull request comments, I'd like to nudge forward our automated style checking, at least for new files being added.

I don't want to totally rewrite server.js just to get automated style checking… the blame tracking is just too useful. So let's it's just take care of that when we start splitting it out.

More discussion in #948.
2017-10-01 21:09:43 -04:00
Paul Melnikow
47ba81a007 Support named logos and omit logos by default (#1092)
- Except for social badges, omit logos by default (#983)
- Omit the logo from a social badge using the query string: `?logo=`
  (#983)
- Opt in to named logos using the query string: `?logo=appveyor`
- Provide custom logo data as before: `?logo=data:image/png;base64,...`
- Rewrite badge data functions, with unit tests

Unit tests are covering the new code very well, though the underlying
functionality (logos) is untested.

Close #983
2017-09-28 10:47:39 -04:00