Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Commit 36da339

Browse files
committed
first try at tests for this
1 parent 951ef59 commit 36da339

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

test/unit/enabledProp.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import test from 'ava'
2+
3+
import Vue from 'vue/dist/vue.common'
4+
import VueTouch from './helpers/vue-touch'
5+
import Hammer from 'hammerjs'
6+
7+
Vue.use(VueTouch)
8+
9+
import {
10+
createFromTemplate,
11+
isEnabled, isDisabled,
12+
allEnabled, allDisabled
13+
} from './helpers'
14+
15+
let vt
16+
17+
test.skip('before', t => {
18+
19+
vt = createFromTemplate(`
20+
<v-touch
21+
@tap="cb"
22+
@swipe="cb"
23+
/>
24+
`)
25+
})
26+
27+
test('prop is true by default & events are enabled', t => {
28+
t.plan(2)
29+
30+
vt = createFromTemplate(`
31+
<v-touch
32+
@tap="cb"
33+
@swipe="cb"
34+
/>
35+
`)
36+
const propEnabled = vt.enabled
37+
t.true(propEnabled)
38+
39+
const rcEnabled = isEnabled(vm, 'tap')
40+
t.true(rcEnabled)
41+
})
42+
43+
test.todo('all rcg disabled when enabled="false"')
44+
45+
test.todo('Passing obj to enabled prop correctly toggles recognizers')

0 commit comments

Comments
 (0)