Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f68f0cd1
Commit
f68f0cd1
authored
May 04, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds numbered lists to easily point to documentation
parent
9eab1db9
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
277 additions
and
282 deletions
+277
-282
doc/development/fe_guide/style_guide_js.md
doc/development/fe_guide/style_guide_js.md
+262
-282
doc/development/fe_guide/vue.md
doc/development/fe_guide/vue.md
+15
-0
No files found.
doc/development/fe_guide/style_guide_js.md
View file @
f68f0cd1
This diff is collapsed.
Click to expand it.
doc/development/fe_guide/vue.md
View file @
f68f0cd1
...
@@ -387,6 +387,10 @@ describe('Todos App', () => {
...
@@ -387,6 +387,10 @@ describe('Todos App', () => {
});
});
});
});
```
```
#### 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.
[
Vue
][
vue-test
]
guide's to unit test show us exactly that:
### Stubbing API responses
### Stubbing API responses
[
Vue Resource Interceptors
][
vue-resource-interceptor
]
allow us to add a interceptor with
[
Vue Resource Interceptors
][
vue-resource-interceptor
]
allow us to add a interceptor with
...
@@ -419,6 +423,16 @@ the response we need:
...
@@ -419,6 +423,16 @@ the response we need:
});
});
```
```
1.
Use
`$.mount()`
to mount the component
```
javascript
// bad
new
Component
({
el
:
document
.
createElement
(
'
div
'
)
});
// good
new
Component
().
$mount
();
```
[
vue-docs
]:
http://vuejs.org/guide/index.html
[
vue-docs
]:
http://vuejs.org/guide/index.html
[
issue-boards
]:
https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/assets/javascripts/boards
[
issue-boards
]:
https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/assets/javascripts/boards
...
@@ -429,5 +443,6 @@ the response we need:
...
@@ -429,5 +443,6 @@ the response we need:
[
one-way-data-flow
]:
https://vuejs.org/v2/guide/components.html#One-Way-Data-Flow
[
one-way-data-flow
]:
https://vuejs.org/v2/guide/components.html#One-Way-Data-Flow
[
vue-resource-repo
]:
https://github.com/pagekit/vue-resource
[
vue-resource-repo
]:
https://github.com/pagekit/vue-resource
[
vue-resource-interceptor
]:
https://github.com/pagekit/vue-resource/blob/develop/docs/http.md#interceptors
[
vue-resource-interceptor
]:
https://github.com/pagekit/vue-resource/blob/develop/docs/http.md#interceptors
[
vue-test
]:
https://vuejs.org/v2/guide/unit-testing.html
[
issue-boards-service
]:
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/boards/services/board_service.js.es6
[
issue-boards-service
]:
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/boards/services/board_service.js.es6
[
flux
]:
https://facebook.github.io/flux
[
flux
]:
https://facebook.github.io/flux
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment