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

Commit

Permalink
fix: change shallow -> shallowMount (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
haru01 authored and eddyerburgh committed Jun 18, 2018
1 parent 722680c commit cf27fcf
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
"vue": "^2.4.4"
},
"devDependencies": {
"@vue/test-utils": "^1.0.0-beta.12",
"@vue/test-utils": "^1.0.0-beta.19",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-istanbul": "^4.1.5",
Expand Down
4 changes: 2 additions & 2 deletions test/List.spec.js
@@ -1,10 +1,10 @@
import { shallow } from '@vue/test-utils'
import { shallowMount } from '@vue/test-utils'
import List from '@/components/List.vue'

describe('List.vue', () => {
it('renders li for each item in props.items', () => {
const items = ['', '']
const wrapper = shallow(List, {
const wrapper = shallowMount(List, {
propsData: { items }
})
expect(wrapper.findAll('li')).toHaveLength(items.length)
Expand Down
6 changes: 3 additions & 3 deletions test/Message.spec.js
@@ -1,18 +1,18 @@
import { shallow } from '@vue/test-utils'
import { shallowMount } from '@vue/test-utils'
import Message from '@/components/Message.vue'

describe('Message.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
const wrapper = shallow(Message, {
const wrapper = shallowMount(Message, {
propsData: { msg }
})
expect(wrapper.text()).toBe(msg)
})

it('renders default message if not passed a prop', () => {
const defaultMessage = 'default message'
const wrapper = shallow(Message)
const wrapper = shallowMount(Message)
expect(wrapper.text()).toBe(defaultMessage)
})
})
4 changes: 2 additions & 2 deletions test/MessageToggle.spec.js
@@ -1,10 +1,10 @@
import { shallow } from '@vue/test-utils'
import { shallowMount } from '@vue/test-utils'
import MessageToggle from '@/components/MessageToggle.vue'
import Message from '@/components/Message.vue'

describe('MessageToggle.vue', () => {
it('toggles msg passed to Message when button is clicked', () => {
const wrapper = shallow(MessageToggle)
const wrapper = shallowMount(MessageToggle)
const button = wrapper.find('#toggle-message')
button.trigger('click')
const MessageComponent = wrapper.find(Message)
Expand Down

0 comments on commit cf27fcf

Please sign in to comment.