Last active
March 5, 2017 16:24
-
-
Save thangman22/511d153c87c4e002780ed8e7341a8524 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Test element after render | |
it('renders the correct message', () => { | |
const Ctor = Vue.extend(MyComponent) | |
const vm = new Ctor().$mount() | |
expect(vm.$el.textContent).toBe('bye!') | |
vm.$el.querySelector('i.fa-smile-o').should.exist | |
}) | |
//Test method after render | |
it('method work correctly', () => { | |
const Ctor = Vue.extend(MyComponent) | |
const vm = new Ctor().$mount() | |
expect(vm.methodA()).toBe('bye!') | |
}) | |
//Test computed after render | |
it('computed work correctly', () => { | |
const Ctor = Vue.extend(MyComponent) | |
const vm = new Ctor().$mount() | |
expect(vm.computedA()).toBe('bye!') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment