Skip to content

Commit 716a694

Browse files
committed
docs: using base directory again
1 parent 964bced commit 716a694

23 files changed

+38
-44
lines changed

src/.vuepress/config.js

+27-27
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,58 @@ const sidebar = {
44
title: 'Essentials',
55
collapsable: false,
66
children: [
7-
'/v2/guide/installation',
8-
'/v2/guide/introduction',
9-
'/v2/guide/a-crash-course',
10-
'/v2/guide/conditional-rendering',
11-
'/v2/guide/event-handling',
12-
'/v2/guide/passing-data',
13-
'/v2/guide/forms'
7+
'/guide/installation',
8+
'/guide/introduction',
9+
'/a-crash-course',
10+
'/conditional-rendering',
11+
'/event-handling',
12+
'/passing-data',
13+
'/forms'
1414
]
1515
},
1616
{
1717
title: 'Vue Test Utils in depth',
1818
collapsable: false,
1919
children: [
20-
'/v2/guide/slots',
21-
'/v2/guide/async-suspense',
22-
'/v2/guide/http-requests',
23-
'/v2/guide/transitions',
24-
'/v2/guide/component-instance',
25-
'/v2/guide/reusability-composition',
26-
'/v2/guide/vuex',
27-
'/v2/guide/vue-router',
28-
'/v2/guide/third-party',
29-
'/v2/guide/stubs-shallow-mount'
20+
'/slots',
21+
'/async-suspense',
22+
'/http-requests',
23+
'/transitions',
24+
'/component-instance',
25+
'/reusability-composition',
26+
'/vuex',
27+
'/vue-router',
28+
'/third-party',
29+
'/stubs-shallow-mount'
3030
]
3131
},
3232
{
3333
title: 'Extending Vue Test Utils',
3434
collapsable: false,
35-
children: ['/v2/guide/plugins', '/v2/guide/community-learning']
35+
children: ['/plugins', '/community-learning']
3636
},
3737
{
3838
title: 'Migration to Vue Test Utils 2',
3939
collapsable: false,
40-
children: ['/v2/guide/migration']
40+
children: ['/migration']
4141
},
4242
{
4343
title: 'API Reference',
4444
collapsable: false,
45-
children: ['/v2/api/']
45+
children: ['/api/']
4646
}
4747
],
4848
api: [
4949
{
5050
title: 'API Reference',
5151
collapsable: false,
52-
children: ['/v2/api/']
52+
children: ['/api/']
5353
}
5454
]
5555
}
5656

5757
module.exports = {
58-
base: '/',
58+
base: '/v2/',
5959
title: 'Vue Test Utils',
6060
locales: {
6161
'/': {
@@ -67,13 +67,13 @@ module.exports = {
6767
editLinks: true,
6868
sidebarDepth: 2,
6969
sidebar: {
70-
'/v2/guide/': sidebar.guide,
71-
'/v2/api/': sidebar.api
70+
'/': sidebar.guide,
71+
'/api/': sidebar.api
7272
},
7373
nav: [
74-
{ text: 'Guide', link: '/v2/guide/introduction' },
75-
{ text: 'API Reference', link: '/v2/api/' },
76-
{ text: 'Migration from VTU 1', link: '/v2/guide/migration' },
74+
{ text: 'Guide', link: '/introduction' },
75+
{ text: 'API Reference', link: '/api/' },
76+
{ text: 'Migration from VTU 1', link: '/migration' },
7777
{ text: 'GitHub', link: 'https://github.com/vuejs/vue-test-utils-next' }
7878
]
7979
}
File renamed without changes.
File renamed without changes.

src/v2/guide/async-suspense.md renamed to src/guide/async-suspense.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You might know Vue updates reactively; when you change a value, the DOM is autom
66

77
## A Simple Example - Updating with `trigger`
88

9-
Let's re-use the `<Counter>` component from [event handling](/v2/guide/event-handling) with one change; we now render the `count` in the `template`.
9+
Let's re-use the `<Counter>` component from [event handling]./event-handling) with one change; we now render the `count` in the `template`.
1010

1111
```js
1212
const Counter = {
@@ -104,7 +104,7 @@ test('uses a mocked axios HTTP client and flush-promises', async () => {
104104

105105
```
106106

107-
> If you haven't tested Components with API requests before, you can learn more in [HTTP Requests](/v2/guide/http-requests).
107+
> If you haven't tested Components with API requests before, you can learn more in [HTTP Requests]./http-requests).
108108
## Conclusion
109109

110110
- Vue updates the DOM asynchronously; tests runner execute code synchronously.
File renamed without changes.
File renamed without changes.

src/v2/guide/conditional-rendering.md renamed to src/guide/conditional-rendering.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ test('does not render an admin link', () => {
6363
})
6464
```
6565

66-
Notice we are calling `exists()` on the value returned from `.find()`? `find()`, like `mount()`, also returns a wrapper, similar to `mount()`. `mount()` has a few extra methods, because it's wrapping a Vue component, and `find()` only returns a regular DOM node, but many of the methods are shared between both. Some other methods include `classes()`, which gets the classes a DOM node has, and `trigger()` for simulating user interaction. You can find a list of methods supported [here](/v2/api/#wrapper-methods).
66+
Notice we are calling `exists()` on the value returned from `.find()`? `find()`, like `mount()`, also returns a wrapper, similar to `mount()`. `mount()` has a few extra methods, because it's wrapping a Vue component, and `find()` only returns a regular DOM node, but many of the methods are shared between both. Some other methods include `classes()`, which gets the classes a DOM node has, and `trigger()` for simulating user interaction. You can find a list of methods supported [here](.,/api/#wrapper-methods).
6767

6868
## Using `data`
6969

70-
The final test is to assert that the admin link is rendered when `admin` is `true`. It's `false` by default, but we can override that using the second argument to `mount()`, the [`mounting options`](/v2/api/#mount-options).
70+
The final test is to assert that the admin link is rendered when `admin` is `true`. It's `false` by default, but we can override that using the second argument to `mount()`, the [`mounting options`](.,/api/#mount-options).
7171

7272
For `data`, we use the aptly named `data` option:
7373

@@ -89,7 +89,7 @@ test('renders an admin link', () => {
8989

9090
If you have other properties in `data`, don't worry - Vue Test Utils will merge the two together. The `data` in the mounting options will take priority over any default values.
9191

92-
To learn what other mounting options exist, see [`Passing Data`](/v2/guide/passing-data.html) or see [`mounting options`](/v2/api/#mount-options).
92+
To learn what other mounting options exist, see [`Passing Data`]./passing-data.html) or see [`mounting options`](.,/api/#mount-options).
9393

9494
## Conclusion
9595

src/v2/guide/event-handling.md renamed to src/guide/event-handling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test('emits an event when clicked', () => {
4040
})
4141
```
4242

43-
> If you haven't seen `trigger()` before, don't worry. It's used to simulate user interaction. You can learn more in [Forms](/v2/guide/forms).
43+
> If you haven't seen `trigger()` before, don't worry. It's used to simulate user interaction. You can learn more in [Forms]./forms).
4444
4545
The first thing to notice is that `emitted()` returns an object, where each key matches an emitted event. In this case, `increment`.
4646

src/v2/guide/forms.md renamed to src/guide/forms.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test('trigger', async () => {
7878
})
7979
```
8080

81-
> If you haven't seen `emitted()` before, don't worry. It's used to assert the emitted events of a Component. You can learn more in [Event Handling](/v2/guide/event-handling).
81+
> If you haven't seen `emitted()` before, don't worry. It's used to assert the emitted events of a Component. You can learn more in [Event Handling]./event-handling).
8282
8383
We trigger the `click` event listener, so that the Component executes the `submit` method. As we did with `setValue`, we use `await` to make sure the action is being reflected by Vue.
8484

@@ -228,7 +228,7 @@ We then make a simple assertion, whether the form emitted the correct event and
228228

229229
#### Native form submission
230230

231-
Triggering a `submit` event on a `<form>` element mimics browser behavior during form submission. If we wanted to trigger form submission more naturally, we could trigger a `click` event on the submit button instead. Since form elements not connected to the `document` cannot be submitted, as per the [HTML specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm), we need to use [`attachTo`](/v2/api/#attachto) to connect the wrapper's element.
231+
Triggering a `submit` event on a `<form>` element mimics browser behavior during form submission. If we wanted to trigger form submission more naturally, we could trigger a `click` event on the submit button instead. Since form elements not connected to the `document` cannot be submitted, as per the [HTML specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm), we need to use [`attachTo`](.,/api/#attachto) to connect the wrapper's element.
232232

233233
#### Multiple modifiers on the same event
234234

File renamed without changes.
File renamed without changes.

src/v2/guide/introduction.md renamed to src/guide/introduction.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ test('displays message', () => {
3838

3939
## What Next?
4040

41-
To see Vue Test Utils in action, [take the Crash Course](/v2/guide/a-crash-course/), where we build a simple Todo app using a test-first approach.
41+
To see Vue Test Utils in action, [take the Crash Course]./a-crash-course/), where we build a simple Todo app using a test-first approach.
4242

4343
Docs are split into two main sections:
4444

4545
* **Essentials**, to cover common uses cases you'll face when testing Vue components.
4646
* **Vue Test Utils in Depth**, to explore other advanced features of the library.
4747

48-
Alternatively, you can explore the full [API](/v2/api/).
48+
Alternatively, you can explore the full [API](.,/api/).
File renamed without changes.

src/v2/guide/passing-data.md renamed to src/guide/passing-data.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test('renders an error if length is too short', () => {
7474
})
7575
```
7676

77-
Writing a test for a `maxLength` rule is left as an exercise for the reader! Another way to write this would be using `setValue` to update the input with a password that is too short. You can learn more in [Forms](/v2/guide/forms).
77+
Writing a test for a `maxLength` rule is left as an exercise for the reader! Another way to write this would be using `setValue` to update the input with a password that is too short. You can learn more in [Forms]./forms).
7878

7979
## Using `setProps`
8080

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/v2/README.md

-6
This file was deleted.

0 commit comments

Comments
 (0)