Commit f0337d33 authored by Amy Qualls's avatar Amy Qualls

Merge branch 'jboyson-master-patch-27220' into 'master'

Consolidate duplicate info re: testing components

See merge request gitlab-org/gitlab!55789
parents 4e9466ae 221fa387
...@@ -237,6 +237,9 @@ Each Vue component has a unique output. This output is always present in the ren ...@@ -237,6 +237,9 @@ Each Vue component has a unique output. This output is always present in the ren
Although each method of a Vue component can be tested individually, our goal is to test the output Although each method of a Vue component can be tested individually, our goal is to test the output
of the render function, which represents the state at all times. of the render function, which represents the state at all times.
Visit the [Vue testing guide](https://vuejs.org/v2/guide/testing.html#Unit-Testing) for help
testing the rendered output.
Here's an example of a well structured unit test for [this Vue component](#appendix---vue-component-subject-under-test): Here's an example of a well structured unit test for [this Vue component](#appendix---vue-component-subject-under-test):
```javascript ```javascript
...@@ -331,11 +334,6 @@ describe('~/todos/app.vue', () => { ...@@ -331,11 +334,6 @@ describe('~/todos/app.vue', () => {
}); });
``` ```
### Test the component's output
The main return value of a Vue component is the rendered output. In order to test the component we
need to test the rendered output. Visit the [Vue testing guide](https://vuejs.org/v2/guide/testing.html#Unit-Testing).
### Child components ### Child components
1. Test any directive that defines if/how child component is rendered (for example, `v-if` and `v-for`). 1. Test any directive that defines if/how child component is rendered (for example, `v-if` and `v-for`).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment