Skip to content
Snippets Groups Projects
Verified Commit 2cd90ff4 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Capitalize filter

parent dac47da5
No related branches found
No related tags found
No related merge requests found
......@@ -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 {}
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')
})
})
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment