angular/aio/tools/transforms/angular-base-package/rendering/toId.spec.js
Borja Paz Rodríguez 9d2401d99a docs: fix several typos (#44508)
PR Close #44508
2022-01-04 12:13:46 -08:00

14 lines
501 B
JavaScript

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() {
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');
});
});