fix(common): capitalize first letter of all words in TitleCasePipe (#13511)

This commit is contained in:
Brandon
2016-12-16 16:24:26 -07:00
committed by Chuck Jazdzewski
parent 4568d5ddac
commit a23fa94ca8
2 changed files with 20 additions and 1 deletions

View File

@ -32,6 +32,14 @@ export function main() {
it('should return titlecase', () => { expect(pipe.transform('foo')).toEqual('Foo'); });
it('should return titlecase for subsequent words',
() => { expect(pipe.transform('one TWO Three fouR')).toEqual('One Two Three Four'); });
it('should support empty strings', () => { expect(pipe.transform('')).toEqual(''); });
it('should persist whitespace',
() => { expect(pipe.transform('one two')).toEqual('One Two'); });
it('should titlecase when there is a new value', () => {
expect(pipe.transform('bar')).toEqual('Bar');
expect(pipe.transform('foo')).toEqual('Foo');