mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 03:29:55 +02:00
Capitalize filter
This commit is contained in:
parent
dac47da584
commit
2cd90ff4bd
2 changed files with 14 additions and 1 deletions
|
@ -28,4 +28,10 @@ export function ago (date) {
|
|||
|
||||
Vue.filter('ago', ago)
|
||||
|
||||
export function capitalize (str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1)
|
||||
}
|
||||
|
||||
Vue.filter('capitalize', capitalize)
|
||||
|
||||
export default {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {truncate, markdown, ago} from '@/filters'
|
||||
import {truncate, markdown, ago, capitalize} from '@/filters'
|
||||
|
||||
describe('filters', () => {
|
||||
describe('truncate', () => {
|
||||
|
@ -32,4 +32,11 @@ describe('filters', () => {
|
|||
expect(output).to.equal('a few seconds ago')
|
||||
})
|
||||
})
|
||||
describe('capitalize', () => {
|
||||
it('works', () => {
|
||||
const input = 'hello world'
|
||||
let output = capitalize(input)
|
||||
expect(output).to.equal('Hello world')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue