Skip to content

Fix example indentation in the Unit Testing Vue Components recipe #1683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/v2/cookbook/unit-testing-vue-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,22 @@ import { shallowMount } from '@vue/test-utils'

describe('Foo', () => {
it('renders a message and responds correctly to user input', () => {
const wrapper = shallowMount(Foo, {
data: {
message: 'Hello World',
username: ''
}
})
const wrapper = shallowMount(Foo, {
data: {
message: 'Hello World',
username: ''
}
})

// see if the message renders
expect(wrapper.find('.message').text()).toEqual('Hello World')
// see if the message renders
expect(wrapper.find('.message').text()).toEqual('Hello World')

// assert the error is rendered
expect(wrapper.find('.error').exists()).toBeTruthy()
// assert the error is rendered
expect(wrapper.find('.error').exists()).toBeTruthy()

// update the `username` and assert error is no longer rendered
wrapper.setData({ username: 'Lachlan' })
expect(wrapper.find('.error').exists()).toBeFalsy()
// update the `username` and assert error is no longer rendered
wrapper.setData({ username: 'Lachlan' })
expect(wrapper.find('.error').exists()).toBeFalsy()
})
})
```
Expand Down