Configure frontend tests (#1293)

While working on #1288 I configured frontend tests. I'm going in a different direction with that, though it seems worth keeping the test configuration. I added tests for one of the helper methods.
This commit is contained in:
Paul Melnikow
2017-11-29 18:19:05 -05:00
committed by GitHub
parent c5e31b5de1
commit f403c2b5d3
4 changed files with 121 additions and 34 deletions

View File

@@ -0,0 +1,17 @@
import { test, given } from 'sazerac';
import { encodeField, default as staticBadgeUri } from './static-badge-uri';
describe('Static badge URI generator', function() {
test(encodeField, () => {
given('foo').expect('foo');
given('').expect('');
given('happy go lucky').expect('happy%20go%20lucky');
given('do-right').expect('do--right');
given('it_is_a_snake').expect('it__is__a__snake');
});
test(staticBadgeUri, () => {
given('http://img.example.com', 'foo', 'bar', 'blue', { style: 'plastic'})
.expect('http://img.example.com/badge/foo-bar-blue.svg?style=plastic');
});
});