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:
17
frontend/lib/static-badge-uri.spec.js
Normal file
17
frontend/lib/static-badge-uri.spec.js
Normal 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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user