-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dave Woodall
committed
Apr 17, 2018
1 parent
7745ee2
commit dde7125
Showing
1 changed file
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
const sum = require('./sum'); | ||
import Vue from 'vue/dist/vue'; | ||
import { mount } from '@vue/test-utils'; | ||
import { mixin as clickaway } from 'vue-clickaway'; | ||
|
||
test('adds 1 + 2 to equal 3', () => { | ||
expect(sum(1, 2)).toBe(3); | ||
test('sanity test', () => { | ||
var wrapper = new Vue({ | ||
mixins: [clickaway], | ||
template: '<p v-on-clickaway="away">Click away</p>', | ||
data: { foo: true }, | ||
methods: { | ||
away() { | ||
console.log('clicked away'); | ||
return 'boom'; | ||
} | ||
} | ||
}).$mount(); | ||
expect(wrapper.away()).toBe('boom'); | ||
}); | ||
|
||
// NOTES | ||
// - look up rollup |