fix: capitalize filter not lower case trailing string, fixes #326

This commit is contained in:
Jun Yang
2021-04-17 10:30:57 +08:00
parent 8bab7957da
commit 65487654c4
2 changed files with 4 additions and 1 deletions
@@ -33,6 +33,9 @@ describe('filters/string', function () {
it('should capitalize first', () => test('{{ "i am good" | capitalize }}', 'I am good'))
it('should return empty for nil', () => test('{{ nil | capitalize }}', ''))
it('should return empty for undefined', async () => test('{{ foo | capitalize }}', ''))
it('should capitalize only first word', async () => test('{{"foo bar" | capitalize}}', 'Foo bar'))
it('should to lower case if prefixed by spaces', async () => test('{{" foo BaR" | capitalize}}', ' foo bar'))
it('should to lower case trailing words', async () => test('{{"foo BaR" | capitalize}}', 'Foo bar'))
})
describe('concat', function () {
it('should concat arrays', () => test(`