You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
878 B
23 lines
878 B
8 years ago
|
import { compile } from '../../../packages/weex-template-compiler'
|
||
|
import { strToRegExp } from '../helpers/index'
|
||
|
|
||
|
describe('compile props', () => {
|
||
|
it('custom props', () => {
|
||
|
const { render, staticRenderFns, errors } = compile(`<div custom="whatever"></div>`)
|
||
|
expect(render).not.toBeUndefined()
|
||
|
expect(staticRenderFns).not.toBeUndefined()
|
||
|
expect(staticRenderFns.length).toEqual(0)
|
||
|
expect(render).toMatch(strToRegExp(`attrs:{"custom":"whatever"}`))
|
||
|
expect(errors).toEqual([])
|
||
|
})
|
||
|
|
||
|
it('camelize props', () => {
|
||
|
const { render, staticRenderFns, errors } = compile(`<div kebab-case="whatever"></div>`)
|
||
|
expect(render).not.toBeUndefined()
|
||
|
expect(staticRenderFns).not.toBeUndefined()
|
||
|
expect(staticRenderFns.length).toEqual(0)
|
||
|
expect(render).toMatch(strToRegExp(`attrs:{"kebabCase":"whatever"}`))
|
||
|
expect(errors).toEqual([])
|
||
|
})
|
||
|
})
|