Last active
November 8, 2020 18:23
-
-
Save vdsabev/ec4a749d8bed879a5933a6ac91322302 to your computer and use it in GitHub Desktop.
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
import { mount } from '@vue/test-utils'; | |
import Counter from './Counter'; | |
describe('Counter', () => { | |
let component; | |
beforeEach(() => { | |
component = mount(Counter); | |
}); | |
it('should emit value set to a specific number', () => { | |
component.vm.setValue(5); | |
expect(component.emitted('input')).toEqual([[5]]); | |
}); | |
it('should emit value incremented by step', () => { | |
component.vm.increment(10); | |
expect(component.emitted('input')).toEqual([[10]]); | |
}); | |
it('should emit value decremented by step', () => { | |
component.vm.decrement(10); | |
expect(component.emitted('input')).toEqual([[-10]]); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment