2017-01-26 14:03:53 +00:00
|
|
|
var factory = require('./toId');
|
|
|
|
|
|
|
|
|
|
describe('toId filter', function() {
|
|
|
|
|
var filter;
|
|
|
|
|
|
|
|
|
|
beforeEach(function() { filter = factory(); });
|
|
|
|
|
|
|
|
|
|
it('should be called "toId"', function() { expect(filter.name).toEqual('toId'); });
|
|
|
|
|
|
|
|
|
|
it('should convert a string to make it appropriate for use as an HTML id', function() {
|
2021-12-16 15:58:17 +00:00
|
|
|
expect(filter.process('This is a big string with €bad#characters¢\nAnd even NewLines'))
|
|
|
|
|
.toEqual('This-is-a-big-string-with--bad-characters--And-even-NewLines');
|
2017-01-26 14:03:53 +00:00
|
|
|
});
|
2021-12-16 15:58:17 +00:00
|
|
|
});
|