Last active
September 30, 2018 04:51
-
-
Save eddyerburgh/fe45541a97e7567b07c070a328d1be32 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 test from 'tape' | |
import { shallow } from '@vue/test-utils' | |
import MessageToggle from '../../src/components/MessageToggle' | |
test('MessageToggle.vue renders default message', t => { | |
t.plan(1) | |
const wrapper = shallow(MessageToggle) | |
t.equal(wrapper.find('p').text(), 'default message', 'has a default message') | |
}) | |
test('MessageToggle.vue renders default message', t => { | |
t.plan(2) | |
const wrapper = shallow(MessageToggle) | |
const button = wrapper.find('#toggle-message') | |
const p = wrapper.find('p') | |
button.trigger('click') | |
t.equal(p.text(), 'message', 'toggles <p> text to "message"') | |
button.trigger('click') | |
t.equal(p.text(), 'toggled message', 'toggles <p> text to "toggled message"') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment